mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-23 08:15:16 +00:00
Fix not assigning new changes to input fields in users/@me
This commit is contained in:
@@ -34,7 +34,6 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res:
|
||||
if (body.banner) body.banner = await handleFile(`/banners/${req.user_id}`, body.banner as string);
|
||||
|
||||
const user = await User.findOneOrFail({ where: { id: req.user_id }, select: [...PrivateUserProjection, "data"] });
|
||||
user.assign(body);
|
||||
|
||||
if (body.password) {
|
||||
if (user.data?.hash) {
|
||||
@@ -65,6 +64,7 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res:
|
||||
}
|
||||
}
|
||||
|
||||
user.assign(body);
|
||||
await user.save();
|
||||
|
||||
// @ts-ignore
|
||||
|
||||
Reference in New Issue
Block a user