From 89ff4bc68513661cb98c27461163c49efb67fb2a Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Tue, 5 Oct 2021 19:37:35 +0200 Subject: [PATCH] :bug: fix client locale --- api/src/routes/users/@me/settings.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {} 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 });