diff options
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 }); |