core: fix user search return null (#651)

pull/655/head
panda 1 year ago committed by GitHub
parent 9f472dea74
commit ba3c4776fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

Loading…
Cancel
Save