fix: also not include self if inactive

This commit is contained in:
Methapon2001 2024-12-10 17:14:44 +07:00
parent 23d9f0054c
commit 6250a84327

View file

@ -61,6 +61,7 @@ export function createPermCondition(
}, },
} }
: undefined, : undefined,
status: opts?.activeOnly ? { not: Status.INACTIVE } : undefined,
}, },
{ {
headOffice: globalAllow(user) headOffice: globalAllow(user)
@ -69,6 +70,7 @@ export function createPermCondition(
user: { some: { userId: user.sub } }, user: { some: { userId: user.sub } },
} }
: undefined, : undefined,
status: opts?.activeOnly ? { not: Status.INACTIVE } : undefined,
}, },
]; ];
} }