This commit is contained in:
Warunee Tamkoo 2025-10-01 16:37:23 +07:00
parent 18aa974c3d
commit d8d376386d

View file

@ -8041,17 +8041,21 @@ export class OrganizationController extends Controller {
});
let check: number = 0;
let notDelete: string[] = [];
await Promise.all(
profileLeave.map(async (profile) => {
profile.leaveReason = "เกษียณอายุราชการ";
profile.isActive = false;
if (profile.keycloak != null) {
if (profile.keycloak != null && profile.keycloak != "") {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) {
profile.keycloak = "";
profile.roleKeycloaks = [];
check += 1;
} else {
// push array not delete
notDelete.push(profile.keycloak);
}
}
@ -8061,6 +8065,6 @@ export class OrganizationController extends Controller {
// จำนวนคนที่ถูกแก้ไขเหตุผลการลาออก
const total = profileLeave.length;
return new HttpSuccess({ total, successAmount: check });
return new HttpSuccess({ total, successAmount: check, notDelete });
}
}