[Fix] กรณีพ้นราชการแก้ไขเป็นไม่ต้อง clear ฟิลด์ keycloak #228
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m7s

This commit is contained in:
harid 2026-04-01 17:50:38 +07:00
parent dc31ec0d7d
commit d553c1406c
5 changed files with 48 additions and 31 deletions

View file

@ -274,14 +274,16 @@ export class KeycloakController extends Controller {
});
if (!profileEmp) {
} else {
const _null: any = null;
profileEmp.keycloak = _null;
// Task #228
// const _null: any = null;
// profileEmp.keycloak = _null;
profileEmp.roleKeycloaks = [];
await this.profileEmpRepo.save(profileEmp);
}
} else {
const _null: any = null;
profile.keycloak = _null;
// Task #228
// const _null: any = null;
// profile.keycloak = _null;
profile.roleKeycloaks = [];
await this.profileRepo.save(profile);
return new HttpSuccess();
@ -566,7 +568,8 @@ export class KeycloakController extends Controller {
.leftJoinAndSelect("current_holders.orgChild2", "orgChild2")
.leftJoinAndSelect("current_holders.orgChild3", "orgChild3")
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
.where("profile.keycloak IS NOT NULL AND profile.keycloak != ''")
// .where("profile.keycloak IS NOT NULL AND profile.keycloak != ''")
.where("profile.isActive = :isActive", { isActive: true })
.andWhere(checkChildFromRole)
.andWhere(conditions)
.andWhere(
@ -609,7 +612,8 @@ export class KeycloakController extends Controller {
.leftJoinAndSelect("current_holders.orgChild2", "orgChild2")
.leftJoinAndSelect("current_holders.orgChild3", "orgChild3")
.leftJoinAndSelect("current_holders.orgChild4", "orgChild4")
.where("profileEmployee.keycloak IS NOT NULL AND profileEmployee.keycloak != ''")
// .where("profileEmployee.keycloak IS NOT NULL AND profileEmployee.keycloak != ''")
.where("profileEmployee.isActive = :isActive", { isActive: true })
.andWhere(checkChildFromRole)
.andWhere(conditions)
.andWhere({ employeeClass: "PERM" })