forked from administration/panel
fix: don't clear projection
parent
b77e545159
commit
7144d889e8
16
lib/db.ts
16
lib/db.ts
|
@ -125,10 +125,10 @@ export async function fetchUserById(id: string) {
|
|||
.findOne(
|
||||
{ _id: id },
|
||||
{
|
||||
projection: {
|
||||
relations: (await hasPermissionFromSession("users/fetch/relations"))
|
||||
? 1
|
||||
: 0,
|
||||
projection: (await hasPermissionFromSession("users/fetch/relations"))
|
||||
? undefined
|
||||
: {
|
||||
relations: 0,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
@ -143,10 +143,10 @@ export async function fetchUsersById(ids: string[]) {
|
|||
.find(
|
||||
{ _id: { $in: ids } },
|
||||
{
|
||||
projection: {
|
||||
relations: (await hasPermissionFromSession("users/fetch/relations"))
|
||||
? 1
|
||||
: 0,
|
||||
projection: (await hasPermissionFromSession("users/fetch/relations"))
|
||||
? undefined
|
||||
: {
|
||||
relations: 0,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue