From e7a973b764013458f548e75cdbe670af4c8d796e Mon Sep 17 00:00:00 2001 From: harid Date: Thu, 16 Apr 2026 15:59:36 +0700 Subject: [PATCH] fix issues #2428 #2383 --- src/controllers/ExRetirementController.ts | 4 +++- src/controllers/ProfileSalaryTempController.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/controllers/ExRetirementController.ts b/src/controllers/ExRetirementController.ts index 128cb4d1..c8ffe5da 100644 --- a/src/controllers/ExRetirementController.ts +++ b/src/controllers/ExRetirementController.ts @@ -15,6 +15,7 @@ import { import HttpError from "../interfaces/http-error"; import HttpStatusCode from "../interfaces/http-status"; import { addLogSequence } from "../interfaces/utils"; +import HttpSuccess from "../interfaces/http-success"; interface CachedToken { token: string; @@ -88,7 +89,8 @@ export class ExRetirementController extends Controller { }, }); - return res.data; + // return res.data; + return new HttpSuccess(res.data.data); } catch (error: any) { if (error.response?.status === 500 && retryCount < maxRetries - 1) { TokenCache.delete(`${clientId}:${clientSecret}`); diff --git a/src/controllers/ProfileSalaryTempController.ts b/src/controllers/ProfileSalaryTempController.ts index fc6a9df5..49c757dc 100644 --- a/src/controllers/ProfileSalaryTempController.ts +++ b/src/controllers/ProfileSalaryTempController.ts @@ -1433,10 +1433,10 @@ export class ProfileSalaryTempController extends Controller { profileEmployeeId: x.profileEmployeeId, dateStart: x.commandDateAffect, dateEnd: null, - posNo: `${x.posNoAbb} ${x.posNo}`, + posNo: `${x.posNoAbb ?? ""} ${x.posNo ?? ""}`.trim(), position: x.positionName, commandId: x.commandId, - refCommandNo: `${x.commandNo}/${x.commandYear}`, + refCommandNo: [x.commandNo, x.commandYear].filter(Boolean).join("/") || undefined, refCommandDate: x.commandDateAffect, status: false, isDeleted: false, @@ -1456,7 +1456,7 @@ export class ProfileSalaryTempController extends Controller { dateStart: x.commandDateAffect, dateEnd: null, commandId: x.commandId, - commandNo: `${x.commandNo}/${x.commandYear}`, + commandNo: [x.commandNo, x.commandYear].filter(Boolean).join("/") || undefined, commandName: x.commandName ?? "ให้ช่วยราชการ", refCommandDate: x.commandDateSign, refId: x.refId,