From 9b34eba2680f1a4e86de14086db9d2059aff9383 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: :bug: fix client locale --- api/src/routes/users/@me/settings.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'api/src') 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 }); -- cgit 1.4.1