diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-05 19:37:35 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-10-05 19:37:35 +0200 |
commit | 9b34eba2680f1a4e86de14086db9d2059aff9383 (patch) | |
tree | aeddea8e98def6fb227c0d182f7ea960ac1f5f39 /api/src/routes/users | |
parent | :sparkles: added autoJoin guild to config (diff) | |
download | server-9b34eba2680f1a4e86de14086db9d2059aff9383.tar.xz |
:bug: fix client locale
Diffstat (limited to 'api/src/routes/users')
-rw-r--r-- | api/src/routes/users/@me/settings.ts | 3 |
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 }); |