From 1ef59141827c812012cc6a7455fe1550727ae831 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Tue, 17 Jun 2025 10:08:18 +0700 Subject: [PATCH] update --- src/controllers/ProfileSalaryController.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/controllers/ProfileSalaryController.ts b/src/controllers/ProfileSalaryController.ts index 44397d5c..b77b90ef 100644 --- a/src/controllers/ProfileSalaryController.ts +++ b/src/controllers/ProfileSalaryController.ts @@ -354,7 +354,14 @@ export class ProfileSalaryController extends Controller { where: { profileId: profileId, commandCode: In(["5", "6", "7"]) }, order: { order: "ASC" }, }); - return new HttpSuccess(record); + const result = record.map((r) => ({ + ...r, + positionExecutive: + r.positionExecutiveField + ? `${r.positionExecutive}(${r.positionExecutiveField})` + : r.positionExecutive ?? null, + })); + return new HttpSuccess(result); } @Get("position/{profileId}") @@ -388,7 +395,16 @@ export class ProfileSalaryController extends Controller { order: { order: "ASC" }, // order: { commandDateAffect: "ASC" }, }); - return new HttpSuccess(record); + + const result = record.map((r) => ({ + ...r, + positionExecutive: + r.positionExecutiveField + ? `${r.positionExecutive}(${r.positionExecutiveField})` + : r.positionExecutive ?? null, + })); + + return new HttpSuccess(result); } @Get("tenure/user")