From 670fa1bfac09768e2e2bdef78c183bc700955f6d Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 5 Nov 2024 09:46:52 +0700 Subject: [PATCH] refactor: map responsible area to string array --- src/controllers/02-user-controller.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/controllers/02-user-controller.ts b/src/controllers/02-user-controller.ts index 3328f1c..76d918d 100644 --- a/src/controllers/02-user-controller.ts +++ b/src/controllers/02-user-controller.ts @@ -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,