forked from administration/panel
fix: don't clear projection
parent
b77e545159
commit
7144d889e8
20
lib/db.ts
20
lib/db.ts
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue