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,9 +62,9 @@ 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") }
}); });