diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index e5b9b553..aa4f6678 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -4341,9 +4341,11 @@ export class CommandController extends Controller { createdAt: new Date(), lastUpdatedAt: new Date(), }; - if (item.isLeave != undefined && item.isLeave == true) { + if (orgRevisionRef && item.isLeave == true){ console.log("profile.current_holders.id>>>",orgRevisionRef.id); await CreatePosMasterHistoryOfficer(orgRevisionRef.id, req, "DELETE"); + } + if (item.isLeave != undefined && item.isLeave == true) { console.log("profile.id>>>",profile.id); await removeProfileInOrganize(profile.id, "OFFICER"); }