refactor: change condition for active only filter
This commit is contained in:
parent
9426a6b3ba
commit
a62d729ce6
1 changed files with 3 additions and 3 deletions
|
|
@ -273,13 +273,13 @@ export class EmployeeController extends Controller {
|
||||||
AND: {
|
AND: {
|
||||||
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
||||||
customerBranch: {
|
customerBranch: {
|
||||||
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
status: activeOnly ? { not: Status.INACTIVE } : undefined,
|
||||||
id: customerBranchId,
|
id: customerBranchId,
|
||||||
customerId,
|
customerId,
|
||||||
customer: isSystem(req.user)
|
customer: isSystem(req.user)
|
||||||
? filterStatus(activeOnly ? Status.ACTIVE : status)
|
? { status: activeOnly ? { not: Status.INACTIVE } : undefined }
|
||||||
: {
|
: {
|
||||||
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
status: activeOnly ? { not: Status.INACTIVE } : undefined,
|
||||||
registeredBranch: {
|
registeredBranch: {
|
||||||
OR: permissionCond(req.user, { activeOnly: activeOnly }),
|
OR: permissionCond(req.user, { activeOnly: activeOnly }),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue