add s3 and local dir support, fix session roles, make sure delete invite checks if its valid first

This commit is contained in:
creations 2025-03-05 08:45:08 -05:00
parent 9a91f1e7e3
commit 774c8e22ce
Signed by: creations
GPG key ID: 8F553AA4320FC711
11 changed files with 171 additions and 12 deletions

View file

@ -1,7 +1,7 @@
import { logger } from "@helpers/logger";
import { type ReservedSQL, sql } from "bun";
const defaultSettings: { key: string; value: string }[] = [
const defaultSettings: Setting[] = [
{ key: "default_role", value: "user" },
{ key: "default_timezone", value: "UTC" },
{ key: "server_timezone", value: "UTC" },
@ -114,10 +114,10 @@ export async function setSetting(
try {
await reservation`
INSERT INTO settings ("key", "value")
VALUES (${key}, ${value})
ON CONFLICT ("key")
DO UPDATE SET "value" = ${value};`;
INSERT INTO settings ("key", "value", updated_at)
VALUES (${key}, ${value}, NOW())
ON CONFLICT ("key")
DO UPDATE SET "value" = ${value}, "updated_at" = NOW();`;
} catch (error) {
logger.error(["Could not set the setting:", error as Error]);
throw error;