update list users for client

This commit is contained in:
2025-06-10 14:57:19 +05:30
parent 8cb6399407
commit 878985c1f4

View File

@@ -125,7 +125,13 @@ export async function listUsers(user: AuthenticatedUser) {
return await userModel
.find({
$and: [
{ tenantId: user.tenantId, orgId: user.orgId, role: "client" },
{ tenantId: user.tenantId },
{
$or: [
{ orgId: user.orgId, role: "client" },
{ role: { $in: ["admin", "team", "superAdmin"] } },
],
},
{ dev: { $ne: true } },
],
})