core: allow username change with cli (#177)

This commit is contained in:
undefined committed 2021-08-20 19:16:36 +08:00
1 parent 689c4cba6d
commit a2f6d1460e
2 files changed
+6 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.32.32",
"version": "2.32.33",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+5
View File
@@ -210,6 +210,11 @@ class UserModel {
return res;
}
@ArgMethod
static setUname(uid: number, uname: string) {
return UserModel.setById(uid, { uname, unameLower: uname.trim().toLowerCase() });
}
@ArgMethod
static setEmail(uid: number, mail: string) {
return UserModel.setById(uid, { mail, mailLower: mail.trim().toLowerCase() });