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(); }