feat: add support for active only employee
resolves https://github.com/Frappet/jws-frontend/issues/147
This commit is contained in:
parent
db3bdfb25d
commit
083c8fcc02
1 changed files with 8 additions and 3 deletions
|
|
@ -207,6 +207,7 @@ export class EmployeeController extends Controller {
|
|||
@Query() query: string = "",
|
||||
@Query() page: number = 1,
|
||||
@Query() pageSize: number = 30,
|
||||
@Query() activeOnly?: boolean,
|
||||
) {
|
||||
return this.listByCriteria(
|
||||
req,
|
||||
|
|
@ -220,6 +221,7 @@ export class EmployeeController extends Controller {
|
|||
query,
|
||||
page,
|
||||
pageSize,
|
||||
activeOnly,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -237,6 +239,7 @@ export class EmployeeController extends Controller {
|
|||
@Query() query: string = "",
|
||||
@Query() page: number = 1,
|
||||
@Query() pageSize: number = 30,
|
||||
@Query() activeOnly?: boolean,
|
||||
@Body()
|
||||
body?: {
|
||||
passport?: string[];
|
||||
|
|
@ -268,15 +271,17 @@ export class EmployeeController extends Controller {
|
|||
]
|
||||
: undefined,
|
||||
AND: {
|
||||
...filterStatus(status),
|
||||
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
||||
customerBranch: {
|
||||
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
||||
id: customerBranchId,
|
||||
customerId,
|
||||
customer: isSystem(req.user)
|
||||
? undefined
|
||||
? filterStatus(activeOnly ? Status.ACTIVE : status)
|
||||
: {
|
||||
...filterStatus(activeOnly ? Status.ACTIVE : status),
|
||||
registeredBranch: {
|
||||
OR: permissionCond(req.user),
|
||||
OR: permissionCond(req.user, { activeOnly: activeOnly }),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue