mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix getDomainUser
This commit is contained in:
1 parent
0bed88ff99
commit
aa096322c3
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.20.22",
|
||||
"version": "2.20.23",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -89,7 +89,7 @@ class DomainModel {
|
||||
const res = await coll.findOneAndUpdate(
|
||||
{ _id: domainId },
|
||||
// FIXME
|
||||
// @ts-ignore
|
||||
// @ts-expect-error
|
||||
{ $inc: { [field]: n } },
|
||||
{ returnOriginal: false },
|
||||
);
|
||||
@@ -182,7 +182,7 @@ class DomainModel {
|
||||
@ArgMethod
|
||||
static async incUserInDomain(domainId: string, uid: number, field: string, n: number = 1) {
|
||||
// @ts-ignore
|
||||
const dudoc = await getDomainUser(domainId, { _id: uid });
|
||||
const dudoc = await DomainModel.getDomainUser(domainId, { _id: uid });
|
||||
dudoc[field] = dudoc[field] + n || n;
|
||||
await DomainModel.setUserInDomain(domainId, uid, { [field]: dudoc[field] });
|
||||
return dudoc;
|
||||
|
||||
Reference in new issue
Block a user