1
0
Fork 0

fix: don't clear projection

fix-1
Paul Makles 2023-07-31 14:46:04 +01:00
parent b77e545159
commit 7144d889e8
No known key found for this signature in database
GPG Key ID: 5059F398521BB0F6
1 changed files with 10 additions and 10 deletions

View File

@ -125,11 +125,11 @@ export async function fetchUserById(id: string) {
.findOne( .findOne(
{ _id: id }, { _id: id },
{ {
projection: { projection: (await hasPermissionFromSession("users/fetch/relations"))
relations: (await hasPermissionFromSession("users/fetch/relations")) ? undefined
? 1 : {
: 0, relations: 0,
}, },
} }
); );
} }
@ -143,11 +143,11 @@ export async function fetchUsersById(ids: string[]) {
.find( .find(
{ _id: { $in: ids } }, { _id: { $in: ids } },
{ {
projection: { projection: (await hasPermissionFromSession("users/fetch/relations"))
relations: (await hasPermissionFromSession("users/fetch/relations")) ? undefined
? 1 : {
: 0, relations: 0,
}, },
} }
) )
.toArray(); .toArray();