summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-12 01:46:42 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-08-13 21:57:51 +0200
commit44859db499f080e3a341f3e7fa5e44611fc2f887 (patch)
treee1f5df7de00929797de517683ff152e5f712bd02 /api/src/routes
parentMake ConfigValue a directory, move defaults to those classes instead of a sep... (diff)
downloadserver-44859db499f080e3a341f3e7fa5e44611fc2f887.tar.xz
Push local state...
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/auth/register.ts1
-rw-r--r--api/src/routes/guilds/#guild_id/index.ts1
-rw-r--r--api/src/routes/users/@me/settings.ts4
3 files changed, 4 insertions, 2 deletions
diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts
index 2baef98e..5a3d27e9 100644
--- a/api/src/routes/auth/register.ts
+++ b/api/src/routes/auth/register.ts
@@ -30,6 +30,7 @@ export interface RegisterSchema {
 	date_of_birth?: Date; // "2000-04-03"
 	gift_code_sku_id?: string;
 	captcha_key?: string;
+	promotional_email_opt_in?: boolean;
 }
 
 router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Response) => {
diff --git a/api/src/routes/guilds/#guild_id/index.ts b/api/src/routes/guilds/#guild_id/index.ts
index abece88e..8d61f753 100644
--- a/api/src/routes/guilds/#guild_id/index.ts
+++ b/api/src/routes/guilds/#guild_id/index.ts
@@ -21,6 +21,7 @@ export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels" |
 	afk_timeout?: number;
 	afk_channel_id?: string;
 	preferred_locale?: string;
+	premium_progress_bar_enabled?: boolean;
 }
 
 router.get("/", route({}), async (req: Request, res: Response) => {
diff --git a/api/src/routes/users/@me/settings.ts b/api/src/routes/users/@me/settings.ts
index 70f8a218..d832575f 100644
--- a/api/src/routes/users/@me/settings.ts
+++ b/api/src/routes/users/@me/settings.ts
@@ -10,8 +10,8 @@ router.patch("/", route({ body: "UserSettingsSchema" }), async (req: Request, re
 	const body = req.body as UserSettings;
 	if (body.locale === "en") body.locale = "en-US"; // fix discord client crash on unkown locale
 
-	const user = await User.findOneOrFail({ where: { id: req.user_id, bot: false } });
-	user.settings = { ...user.settings, ...body };
+	const user = await User.findOneOrFail({ where: { id: req.user_id, bot: false }, relations: ["settings"] });
+	user.settings = { ...user.settings, ...body } as UserSettings;
 	await user.save();
 
 	res.sendStatus(204);