1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-12 21:52:40 +01:00

Merge remote-tracking branch 'origin/fix/claim_accounts' into slowcord

This commit is contained in:
Madeline 2022-05-31 20:03:41 +10:00
commit 3ea721b4ba

View File

@ -62,14 +62,14 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res:
user.data.hash = await bcrypt.hash(body.new_password, 12);
}
if(body.username){
var check_username = body?.username?.replace(/\s/g, '');
if(!check_username) {
throw FieldErrors({
username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") }
});
}
}
if (body.username) {
var check_username = body?.username?.replace(/\s/g, '');
if (!check_username) {
throw FieldErrors({
username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") }
});
}
}
user.assign(body);
await user.save();