core: fix user search return null (#651)

This commit is contained in:
panda authored and GitHub committed 2023-08-29 15:46:20 +08:00
1 parent 9f472dea74
commit ba3c4776fa
1 file changed
+1 -1
+1 -1
View File
@@ -401,7 +401,7 @@ class UserModel {
.limit(limit).project({ _id: 1 }).toArray();
const dudocs = await domain.getMultiUserInDomain(domainId, { displayName: { $regex } }).limit(limit).project({ uid: 1 }).toArray();
const uids = uniq([...udocs.map(({ _id }) => _id), ...dudocs.map(({ uid }) => uid)]);
return await Promise.all(uids.map(({ _id }) => UserModel.getById(domainId, _id)));
return await Promise.all(uids.map((_id) => UserModel.getById(domainId, _id)));
}
@ArgMethod