diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 532a8059..2c42c54b 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -3085,11 +3085,11 @@ export class CommandController extends Controller { const exceptClear = await checkExceptCommandType(String(item.commandId)); if (item.isLeave == true && !exceptClear) { await removeProfileInOrganize(_profile.id, "OFFICER"); - } - //คำสั่งพักราชการ หรือ ให้ออกจากราชการไว้ก่อน solutionเดิม ให้ disable user ไว้แต่ยังไม่ลบ เปลี่ยนเป็นลบ user ออกเลย - else if (item.isLeave == true && exceptClear && _profile.keycloak != null) { - // const enableActive = await enableStatus(_profile.keycloak, false); - // if (!enableActive) throw new Error("Failed. Cannot change enable status."); + // } + // //คำสั่งพักราชการ หรือ ให้ออกจากราชการไว้ก่อน solutionเดิม ให้ disable user ไว้แต่ยังไม่ลบ เปลี่ยนเป็นลบ user ออกเลย + // else if (item.isLeave == true && exceptClear && _profile.keycloak != null) { + // // const enableActive = await enableStatus(_profile.keycloak, false); + // // if (!enableActive) throw new Error("Failed. Cannot change enable status."); const delUserKeycloak = await deleteUser(_profile.keycloak); if (delUserKeycloak) { _profile.keycloak = _null; @@ -3274,11 +3274,11 @@ export class CommandController extends Controller { const exceptClear = await checkExceptCommandType(String(item.commandId)); if (item.isLeave == true && !exceptClear) { await removeProfileInOrganize(_profile.id, "EMPLOYEE"); - } - //คำสั่งพักราชการ หรือ ให้ออกจากราชการไว้ก่อน solutionเดิม ให้ disable user ไว้แต่ยังไม่ลบ เปลี่ยนเป็นลบ user ออกเลย - else if (item.isLeave == true && exceptClear && _profile.keycloak != null) { - // const enableActive = await enableStatus(_profile.keycloak, false); - // if (!enableActive) throw new Error("Failed. Cannot change enable status."); + // } + // //คำสั่งพักราชการ หรือ ให้ออกจากราชการไว้ก่อน solutionเดิม ให้ disable user ไว้แต่ยังไม่ลบ เปลี่ยนเป็นลบ user ออกเลย + // else if (item.isLeave == true && exceptClear && _profile.keycloak != null) { + // // const enableActive = await enableStatus(_profile.keycloak, false); + // // if (!enableActive) throw new Error("Failed. Cannot change enable status."); const delUserKeycloak = await deleteUser(_profile.keycloak); if (delUserKeycloak) { _profile.keycloak = _null; @@ -3499,11 +3499,11 @@ export class CommandController extends Controller { const exceptClear = await checkExceptCommandType(String(item.commandId)); if (item.isLeave == true && !exceptClear) { await removeProfileInOrganize(_profile.id, "EMPLOYEE"); - } - //คำสั่งพักราชการ หรือ ให้ออกจากราชการไว้ก่อน solutionเดิม ให้ disable user ไว้แต่ยังไม่ลบ เปลี่ยนเป็นลบ user ออกเลย - else if (item.isLeave == true && exceptClear && _profile.keycloak != null) { - // const enableActive = await enableStatus(_profile.keycloak, false); - // if (!enableActive) throw new Error("Failed. Cannot change enable status."); + // } + // //คำสั่งพักราชการ หรือ ให้ออกจากราชการไว้ก่อน solutionเดิม ให้ disable user ไว้แต่ยังไม่ลบ เปลี่ยนเป็นลบ user ออกเลย + // else if (item.isLeave == true && exceptClear && _profile.keycloak != null) { + // // const enableActive = await enableStatus(_profile.keycloak, false); + // // if (!enableActive) throw new Error("Failed. Cannot change enable status."); const delUserKeycloak = await deleteUser(_profile.keycloak); if (delUserKeycloak) { _profile.keycloak = _null;