From 484d2994cee46d54cabc603cb673654b99a914df Mon Sep 17 00:00:00 2001 From: Adisak Date: Thu, 13 Nov 2025 11:49:38 +0700 Subject: [PATCH] fix --- src/controllers/CommandController.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); }