From c5790110212f4cf9233c43da46a1a9089a4d1a61 Mon Sep 17 00:00:00 2001 From: kittapath Date: Thu, 17 Oct 2024 11:06:58 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=89=20=E0=B8=B4?= =?UTF-8?q?=E0=B8=99=E0=B8=81=E0=B8=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/WorkflowController.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index 3bbd31dc..24710642 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -307,13 +307,25 @@ export class WorkflowController extends Controller { }, }, order: { order: "ASC", stateUserComments: { order: "ASC" } }, - relations: ["stateUserComments"], + relations: ["stateUserComments", "stateUserComments.profile"], }); const _state = state.map((x) => ({ stateId: x.id, stateNo: x.order, stateName: x.name, - stateUserComments: x.stateUserComments, + stateUserComments: x.stateUserComments.map((x) => ({ + id: x.id, + prefix: x.profile.prefix, + firstName: x.profile.firstName, + lastName: x.profile.lastName, + profileId: x.profileId, + isAcceptSetting: x.isAcceptSetting, + isApproveSetting: x.isApproveSetting, + isReasonSetting: x.isReasonSetting, + isAccept: x.isAccept, + isApprove: x.isApprove, + reason: x.reason, + })), })); return new HttpSuccess(_state); }