mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-11 05:02:37 +01:00
🐛 fix client locale
This commit is contained in:
parent
1bc56e5131
commit
89ff4bc685
@ -4,10 +4,11 @@ import { route } from "@fosscord/api";
|
|||||||
|
|
||||||
const router = Router();
|
const router = Router();
|
||||||
|
|
||||||
export interface UserSettingsSchema extends UserSettings {}
|
export interface UserSettingsSchema extends Partial<UserSettings> {}
|
||||||
|
|
||||||
router.patch("/", route({ body: "UserSettingsSchema" }), async (req: Request, res: Response) => {
|
router.patch("/", route({ body: "UserSettingsSchema" }), async (req: Request, res: Response) => {
|
||||||
const body = req.body as UserSettings;
|
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
|
// only users can update user settings
|
||||||
await User.update({ id: req.user_id, bot: false }, { settings: body });
|
await User.update({ id: req.user_id, bot: false }, { settings: body });
|
||||||
|
Loading…
Reference in New Issue
Block a user