core: fix showDisplayName

This commit is contained in:
undefined committed 2024-05-11 02:06:07 +08:00
1 parent b8f616ee77
commit 35244cde62
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "4.12.1",
"version": "4.12.2",
"bin": "bin/hydrooj.js",
"main": "src/plugin-api",
"module": "src/plugin-api",
+1 -1
View File
@@ -388,7 +388,7 @@ class UserModel {
const [udocs, vudocs, dudocs] = await Promise.all([
UserModel.getMulti({ _id: { $in: uids } }, ['_id', 'uname', 'mail', 'avatar', 'school', 'studentId']).toArray(),
collV.find({ _id: { $in: uids } }).toArray(),
domain.getDomainUserMulti(domainId, uids).project({ uid: true, displayName: showDisplayName }).toArray(),
domain.getDomainUserMulti(domainId, uids).project({ uid: 1, ...(showDisplayName ? { displayName: 1 } : {}) }).toArray(),
]);
const udict = {};
for (const udoc of udocs) udict[udoc._id] = udoc;