refactor: map responsible area to string array
This commit is contained in:
parent
8c02f31d16
commit
670fa1bfac
1 changed files with 2 additions and 0 deletions
|
|
@ -294,6 +294,7 @@ export class UserController extends Controller {
|
||||||
prisma.user.findMany({
|
prisma.user.findMany({
|
||||||
orderBy: [{ statusOrder: "asc" }, { createdAt: "asc" }],
|
orderBy: [{ statusOrder: "asc" }, { createdAt: "asc" }],
|
||||||
include: {
|
include: {
|
||||||
|
responsibleArea: true,
|
||||||
province: true,
|
province: true,
|
||||||
district: true,
|
district: true,
|
||||||
subDistrict: true,
|
subDistrict: true,
|
||||||
|
|
@ -311,6 +312,7 @@ export class UserController extends Controller {
|
||||||
return {
|
return {
|
||||||
result: result.map((v) => ({
|
result: result.map((v) => ({
|
||||||
...v,
|
...v,
|
||||||
|
responsibleArea: v.responsibleArea.map((v) => v.area),
|
||||||
branch: includeBranch ? v.branch.map((a) => a.branch) : undefined,
|
branch: includeBranch ? v.branch.map((a) => a.branch) : undefined,
|
||||||
})),
|
})),
|
||||||
page,
|
page,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue