Pull data with CustomerBranch
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 7s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 7s
This commit is contained in:
parent
a06d5514fc
commit
62def572de
1 changed files with 13 additions and 10 deletions
|
|
@ -187,14 +187,18 @@ export class RequestDataController extends Controller {
|
|||
employeePassport: {
|
||||
orderBy: { expireDate: "desc" },
|
||||
},
|
||||
province: {
|
||||
customerBranch: {
|
||||
include: {
|
||||
employmentOffice: true,
|
||||
},
|
||||
},
|
||||
district: {
|
||||
include: {
|
||||
employmentOffice: true,
|
||||
province: {
|
||||
include: {
|
||||
employmentOffice: true,
|
||||
},
|
||||
},
|
||||
district: {
|
||||
include: {
|
||||
employmentOffice: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -210,9 +214,8 @@ export class RequestDataController extends Controller {
|
|||
const dataRequestData = result.map((item) => {
|
||||
const employee = item.employee;
|
||||
const dataOffice =
|
||||
item.employee.provinceId === "10"
|
||||
? employee.district?.employmentOffice
|
||||
: employee.province?.employmentOffice;
|
||||
employee.customerBranch.district?.employmentOffice.at(0) ??
|
||||
employee.customerBranch.province?.employmentOffice.at(0);
|
||||
|
||||
return {
|
||||
...item,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue