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({
|
||||
orderBy: [{ statusOrder: "asc" }, { createdAt: "asc" }],
|
||||
include: {
|
||||
responsibleArea: true,
|
||||
province: true,
|
||||
district: true,
|
||||
subDistrict: true,
|
||||
|
|
@ -311,6 +312,7 @@ export class UserController extends Controller {
|
|||
return {
|
||||
result: result.map((v) => ({
|
||||
...v,
|
||||
responsibleArea: v.responsibleArea.map((v) => v.area),
|
||||
branch: includeBranch ? v.branch.map((a) => a.branch) : undefined,
|
||||
})),
|
||||
page,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue