summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-05 19:37:35 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-10-05 19:37:35 +0200
commit9b34eba2680f1a4e86de14086db9d2059aff9383 (patch)
treeaeddea8e98def6fb227c0d182f7ea960ac1f5f39
parent:sparkles: added autoJoin guild to config (diff)
downloadserver-9b34eba2680f1a4e86de14086db9d2059aff9383.tar.xz
:bug: fix client locale
-rw-r--r--api/src/routes/users/@me/settings.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/src/routes/users/@me/settings.ts b/api/src/routes/users/@me/settings.ts
index 9d7a2545..4e014126 100644
--- a/api/src/routes/users/@me/settings.ts
+++ b/api/src/routes/users/@me/settings.ts
@@ -4,10 +4,11 @@ import { route } from "@fosscord/api";
 
 const router = Router();
 
-export interface UserSettingsSchema extends UserSettings {}
+export interface UserSettingsSchema extends Partial<UserSettings> {}
 
 router.patch("/", route({ body: "UserSettingsSchema" }), async (req: Request, res: Response) => {
 	const body = req.body as UserSettings;
+	if (body.locale === "en") body.locale = "en-US"; // fix discord client crash on unkown locale
 
 	// only users can update user settings
 	await User.update({ id: req.user_id, bot: false }, { settings: body });