feat: filter by customerId
This commit is contained in:
parent
a028d8f9b3
commit
ba74eccec7
1 changed files with 4 additions and 0 deletions
|
|
@ -260,6 +260,7 @@ export class EmployeeController extends Controller {
|
||||||
@Query() zipCode?: string,
|
@Query() zipCode?: string,
|
||||||
@Query() gender?: string,
|
@Query() gender?: string,
|
||||||
@Query() status?: Status,
|
@Query() status?: Status,
|
||||||
|
@Query() customerId?: string,
|
||||||
@Query() query: string = "",
|
@Query() query: string = "",
|
||||||
@Query() page: number = 1,
|
@Query() page: number = 1,
|
||||||
@Query() pageSize: number = 30,
|
@Query() pageSize: number = 30,
|
||||||
|
|
@ -279,6 +280,9 @@ export class EmployeeController extends Controller {
|
||||||
{ lastName: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
{ lastName: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
||||||
{ lastNameEN: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
{ lastNameEN: { contains: query }, zipCode, gender, ...filterStatus(status) },
|
||||||
],
|
],
|
||||||
|
AND: {
|
||||||
|
customerBranch: customerId ? { id: customerId } : undefined,
|
||||||
|
},
|
||||||
} satisfies Prisma.EmployeeWhereInput;
|
} satisfies Prisma.EmployeeWhereInput;
|
||||||
|
|
||||||
const [result, total] = await prisma.$transaction([
|
const [result, total] = await prisma.$transaction([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue