From 381b9088acd8733231764bc1983fe62b08987655 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Wed, 7 May 2025 11:42:33 +0700 Subject: [PATCH] fix --- src/controllers/ProfileController.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index 5621ec48..c9e47477 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -10038,7 +10038,7 @@ export class ProfileController extends Controller { orgChild3: orgChild3Ref?.orgChild3Name, orgChild4: orgChild4Ref?.orgChild4Name, commandYear: new Date().getFullYear() + 543, - commandDateSign: new Date(), + // commandDateSign: new Date(), commandDateAffect: new Date(), commandCode: "16", commandName: "พ้นจากราชการ", @@ -10051,6 +10051,7 @@ export class ProfileController extends Controller { lastUpdateFullName: request.user.name, createdAt: new Date(), lastUpdatedAt: new Date(), + remark: "ถึงแก่กรรม", }; delete data.id; @@ -10066,13 +10067,10 @@ export class ProfileController extends Controller { profile.isLeave = requestBody.isLeave; profile.leaveReason = requestBody.leaveReason; profile.dateLeave = requestBody.dateLeave; - if (requestBody.isLeave == true) { - await removeProfileInOrganize(profile.id, "OFFICER"); - } profile.leaveType = "RETIRE_DECEASED"; - profile.position = _null; - profile.posLevelId = _null; - profile.posTypeId = _null; + // profile.position = _null; + // profile.posLevelId = _null; + // profile.posTypeId = _null; if (profile.keycloak != null) { const delUserKeycloak = await deleteUser(profile.keycloak); if (delUserKeycloak) { @@ -10083,7 +10081,9 @@ export class ProfileController extends Controller { } await this.profileRepo.save(profile, { data: request }); setLogDataDiff(request, { before, after: profile }); - await removeProfileInOrganize(profile.id, "OFFICER"); + if (requestBody.isLeave == true) { + await removeProfileInOrganize(profile.id, "OFFICER"); + } return new HttpSuccess(); }