updata user add employmentOffice
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
This commit is contained in:
parent
70245a2b4f
commit
a06d5514fc
5 changed files with 55 additions and 9 deletions
|
|
@ -187,6 +187,16 @@ export class RequestDataController extends Controller {
|
|||
employeePassport: {
|
||||
orderBy: { expireDate: "desc" },
|
||||
},
|
||||
province: {
|
||||
include: {
|
||||
employmentOffice: true,
|
||||
},
|
||||
},
|
||||
district: {
|
||||
include: {
|
||||
employmentOffice: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -197,7 +207,28 @@ export class RequestDataController extends Controller {
|
|||
prisma.requestData.count({ where }),
|
||||
]);
|
||||
|
||||
return { result, page, pageSize, total };
|
||||
const dataRequestData = result.map((item) => {
|
||||
const employee = item.employee;
|
||||
const dataOffice =
|
||||
item.employee.provinceId === "10"
|
||||
? employee.district?.employmentOffice
|
||||
: employee.province?.employmentOffice;
|
||||
|
||||
return {
|
||||
...item,
|
||||
employee: {
|
||||
...employee,
|
||||
dataOffice,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
return {
|
||||
result: dataRequestData,
|
||||
page,
|
||||
pageSize,
|
||||
total,
|
||||
};
|
||||
}
|
||||
|
||||
@Get("{requestDataId}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue