feat: add support for getting relation
This commit is contained in:
parent
5366d9a291
commit
448e3b555c
1 changed files with 8 additions and 0 deletions
|
|
@ -195,6 +195,8 @@ export class EmployeeController extends Controller {
|
||||||
@Query() zipCode?: string,
|
@Query() zipCode?: string,
|
||||||
@Query() gender?: string,
|
@Query() gender?: string,
|
||||||
@Query() status?: Status,
|
@Query() status?: Status,
|
||||||
|
@Query() visa?: boolean,
|
||||||
|
@Query() passport?: boolean,
|
||||||
@Query() customerId?: string,
|
@Query() customerId?: string,
|
||||||
@Query() query: string = "",
|
@Query() query: string = "",
|
||||||
@Query() page: number = 1,
|
@Query() page: number = 1,
|
||||||
|
|
@ -229,6 +231,12 @@ export class EmployeeController extends Controller {
|
||||||
prisma.employee.findMany({
|
prisma.employee.findMany({
|
||||||
orderBy: [{ statusOrder: "asc" }, { createdAt: "asc" }],
|
orderBy: [{ statusOrder: "asc" }, { createdAt: "asc" }],
|
||||||
include: {
|
include: {
|
||||||
|
employeePassport: {
|
||||||
|
orderBy: { expireDate: "desc" },
|
||||||
|
},
|
||||||
|
employeeVisa: {
|
||||||
|
orderBy: { expireDate: "desc" },
|
||||||
|
},
|
||||||
province: true,
|
province: true,
|
||||||
district: true,
|
district: true,
|
||||||
subDistrict: true,
|
subDistrict: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue