Merge remote-tracking branch 'origin/fix/claim_accounts' into slowcord
This commit is contained in:
commit
3ea721b4ba
@ -62,14 +62,14 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res:
|
|||||||
user.data.hash = await bcrypt.hash(body.new_password, 12);
|
user.data.hash = await bcrypt.hash(body.new_password, 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(body.username){
|
if (body.username) {
|
||||||
var check_username = body?.username?.replace(/\s/g, '');
|
var check_username = body?.username?.replace(/\s/g, '');
|
||||||
if(!check_username) {
|
if (!check_username) {
|
||||||
throw FieldErrors({
|
throw FieldErrors({
|
||||||
username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") }
|
username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
user.assign(body);
|
user.assign(body);
|
||||||
await user.save();
|
await user.save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user