mirror of
https://github.com/spacebarchat/server.git
synced 2026-04-25 22:42:09 +00:00
Push local state...
This commit is contained in:
@@ -30,6 +30,7 @@ export interface RegisterSchema {
|
||||
date_of_birth?: Date; // "2000-04-03"
|
||||
gift_code_sku_id?: string;
|
||||
captcha_key?: string;
|
||||
promotional_email_opt_in?: boolean;
|
||||
}
|
||||
|
||||
router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Response) => {
|
||||
|
||||
@@ -21,6 +21,7 @@ export interface GuildUpdateSchema extends Omit<GuildCreateSchema, "channels" |
|
||||
afk_timeout?: number;
|
||||
afk_channel_id?: string;
|
||||
preferred_locale?: string;
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
router.get("/", route({}), async (req: Request, res: Response) => {
|
||||
|
||||
@@ -10,8 +10,8 @@ router.patch("/", route({ body: "UserSettingsSchema" }), async (req: Request, re
|
||||
const body = req.body as UserSettings;
|
||||
if (body.locale === "en") body.locale = "en-US"; // fix discord client crash on unkown locale
|
||||
|
||||
const user = await User.findOneOrFail({ where: { id: req.user_id, bot: false } });
|
||||
user.settings = { ...user.settings, ...body };
|
||||
const user = await User.findOneOrFail({ where: { id: req.user_id, bot: false }, relations: ["settings"] });
|
||||
user.settings = { ...user.settings, ...body } as UserSettings;
|
||||
await user.save();
|
||||
|
||||
res.sendStatus(204);
|
||||
|
||||
Reference in New Issue
Block a user