mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fix setMulti
This commit is contained in:
1 parent
19024c7161
commit
f3153993f7
2 files changed
+3
-4
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.24.7",
|
||||
"version": "2.24.8",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -118,10 +118,9 @@ class DomainModel {
|
||||
deleteUserCache(udoc);
|
||||
return res;
|
||||
}
|
||||
const filter = { domainId, uid: { $in: uid } };
|
||||
const affected = await UserModel.getMulti(filter).project({ mail: 1, uname: 1 }).toArray();
|
||||
const affected = await UserModel.getMulti({ _id: { $in: uid } }).project({ mail: 1, uname: 1 }).toArray();
|
||||
affected.forEach((udoc) => deleteUserCache(udoc));
|
||||
return await collUser.updateMany(filter, { $set: { role } }, { upsert: true });
|
||||
return await collUser.updateMany({ domainId, uid: { $in: uid } }, { $set: { role } }, { upsert: true });
|
||||
}
|
||||
|
||||
static async getRoles(domainId: string, count?: boolean): Promise<any[]>;
|
||||
|
||||
Reference in new issue
Block a user