no message

This commit is contained in:
kittapath 2025-01-21 18:37:39 +07:00
parent 4d744c7c34
commit be13a52af4

View file

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