fix
This commit is contained in:
parent
18aa974c3d
commit
d8d376386d
1 changed files with 6 additions and 2 deletions
|
|
@ -8041,17 +8041,21 @@ export class OrganizationController extends Controller {
|
||||||
});
|
});
|
||||||
|
|
||||||
let check: number = 0;
|
let check: number = 0;
|
||||||
|
let notDelete: string[] = [];
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
profileLeave.map(async (profile) => {
|
profileLeave.map(async (profile) => {
|
||||||
profile.leaveReason = "เกษียณอายุราชการ";
|
profile.leaveReason = "เกษียณอายุราชการ";
|
||||||
profile.isActive = false;
|
profile.isActive = false;
|
||||||
|
|
||||||
if (profile.keycloak != null) {
|
if (profile.keycloak != null && profile.keycloak != "") {
|
||||||
const delUserKeycloak = await deleteUser(profile.keycloak);
|
const delUserKeycloak = await deleteUser(profile.keycloak);
|
||||||
if (delUserKeycloak) {
|
if (delUserKeycloak) {
|
||||||
profile.keycloak = "";
|
profile.keycloak = "";
|
||||||
profile.roleKeycloaks = [];
|
profile.roleKeycloaks = [];
|
||||||
check += 1;
|
check += 1;
|
||||||
|
} else {
|
||||||
|
// push array not delete
|
||||||
|
notDelete.push(profile.keycloak);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -8061,6 +8065,6 @@ export class OrganizationController extends Controller {
|
||||||
|
|
||||||
// จำนวนคนที่ถูกแก้ไขเหตุผลการลาออก
|
// จำนวนคนที่ถูกแก้ไขเหตุผลการลาออก
|
||||||
const total = profileLeave.length;
|
const total = profileLeave.length;
|
||||||
return new HttpSuccess({ total, successAmount: check });
|
return new HttpSuccess({ total, successAmount: check, notDelete });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue