update
This commit is contained in:
parent
1680c7eba1
commit
c4e1ee5546
1 changed files with 11 additions and 5 deletions
|
|
@ -4265,8 +4265,16 @@ export class CommandController extends Controller {
|
|||
await Promise.all(
|
||||
body.data.map(async (item) => {
|
||||
const profile: any = await this.profileRepository.findOne({
|
||||
where: { id: item.profileId },
|
||||
relations: ["roleKeycloaks"],
|
||||
where: {
|
||||
id: item.profileId ,
|
||||
current_holders: {
|
||||
orgRevision: {
|
||||
orgRevisionIsCurrent: true,
|
||||
orgRevisionIsDraft: false,
|
||||
},
|
||||
}
|
||||
},
|
||||
relations: ["current_holders","roleKeycloaks"],
|
||||
});
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||
|
|
@ -4310,9 +4318,7 @@ export class CommandController extends Controller {
|
|||
lastUpdatedAt: new Date(),
|
||||
};
|
||||
if (item.isLeave != undefined && item.isLeave == true) {
|
||||
// if(orgRevisionRef){
|
||||
// await CreatePosMasterHistoryOfficer(orgRevisionRef.id, req, "DELETE");
|
||||
// }
|
||||
await CreatePosMasterHistoryOfficer(profile.current_holders.id, req, "DELETE");
|
||||
await removeProfileInOrganize(profile.id, "OFFICER");
|
||||
}
|
||||
const clearProfile = await checkCommandType(String(item.commandId));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue