mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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
@@ -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