test
This commit is contained in:
parent
62750576d3
commit
92f4ccb30a
1 changed files with 12 additions and 12 deletions
|
|
@ -4266,21 +4266,21 @@ export class CommandController extends Controller {
|
|||
body.data.map(async (item) => {
|
||||
const profile: any = await this.profileRepository.findOne({
|
||||
where: { id: item.profileId },
|
||||
relations: ["roleKeycloaks","current_holders"],
|
||||
relations: ["roleKeycloaks"],
|
||||
});
|
||||
if (!profile) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลทะเบียนประวัตินี้");
|
||||
}
|
||||
|
||||
const orgRevision = await this.orgRevisionRepo.findOne({
|
||||
where: {
|
||||
orgRevisionIsCurrent: true,
|
||||
orgRevisionIsDraft: false,
|
||||
},
|
||||
});
|
||||
// const orgRevision = await this.orgRevisionRepo.findOne({
|
||||
// where: {
|
||||
// orgRevisionIsCurrent: true,
|
||||
// orgRevisionIsDraft: false,
|
||||
// },
|
||||
// });
|
||||
|
||||
const orgRevisionRef =
|
||||
profile?.current_holders?.find((x:any) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||
// const orgRevisionRef =
|
||||
// profile?.current_holders?.find((x:any) => x.orgRevisionId == orgRevision?.id) ?? null;
|
||||
|
||||
//ลบตำแหน่งที่รักษาการแทน
|
||||
const code = _command?.commandType?.code;
|
||||
|
|
@ -4310,9 +4310,9 @@ export class CommandController extends Controller {
|
|||
lastUpdatedAt: new Date(),
|
||||
};
|
||||
if (item.isLeave != undefined && item.isLeave == true) {
|
||||
if(orgRevisionRef){
|
||||
await CreatePosMasterHistoryOfficer(orgRevisionRef.id, req, "DELETE");
|
||||
}
|
||||
// if(orgRevisionRef){
|
||||
// await CreatePosMasterHistoryOfficer(orgRevisionRef.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