diff --git a/src/controllers/03-employee-controller.ts b/src/controllers/03-employee-controller.ts index 038f6bd..994e246 100644 --- a/src/controllers/03-employee-controller.ts +++ b/src/controllers/03-employee-controller.ts @@ -273,13 +273,13 @@ export class EmployeeController extends Controller { AND: { ...filterStatus(activeOnly ? Status.ACTIVE : status), customerBranch: { - ...filterStatus(activeOnly ? Status.ACTIVE : status), + status: activeOnly ? { not: Status.INACTIVE } : undefined, id: customerBranchId, customerId, 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: { OR: permissionCond(req.user, { activeOnly: activeOnly }), },