Merge branch 'fix/electron_premium_since' into maddyrtc

This commit is contained in:
Madeline 2022-03-08 21:46:51 +11:00
commit 3b439f74f1
2 changed files with 9 additions and 7 deletions

View File

@ -57,12 +57,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);
} }
var check_username = body?.username?.replace(/\s/g, ''); if(body.username){
if(!check_username && !body?.avatar && !body?.banner) { var check_username = body?.username?.replace(/\s/g, '');
throw FieldErrors({ if(!check_username) {
username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") } throw FieldErrors({
}); username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") }
} });
}
}
await user.save(); await user.save();

View File

@ -86,7 +86,7 @@ export class Member extends BaseClassWithoutId {
joined_at: Date; joined_at: Date;
@Column({ nullable: true }) @Column({ nullable: true })
premium_since?: Date; premium_since?: number;
@Column() @Column()
deaf: boolean; deaf: boolean;