[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

@ -3459,9 +3459,9 @@ export class ProfileEmployeeTempController extends Controller {
}
/**
* API
* API
*
* @summary (ADMIN)
* @summary (ADMIN)
*
* @param {string} id Id
*/
@ -3586,7 +3586,8 @@ export class ProfileEmployeeTempController extends Controller {
if (profile.keycloak != null) {
const delUserKeycloak = await deleteUser(profile.keycloak);
if (delUserKeycloak) {
profile.keycloak = _null;
// Task #228
// profile.keycloak = _null;
profile.roleKeycloaks = [];
profile.isActive = false;
}
@ -3987,7 +3988,7 @@ export class ProfileEmployeeTempController extends Controller {
case "citizenId":
[findProfile, total] = await this.profileRepo.findAndCount({
where: {
keycloak: IsNull(),
isActive: false,
citizenId: Like(`%${body.keyword}%`),
},
relations: ["posType", "posLevel", "current_holders"],
@ -3999,7 +4000,7 @@ export class ProfileEmployeeTempController extends Controller {
case "firstname":
[findProfile, total] = await this.profileRepo.findAndCount({
where: {
keycloak: IsNull(),
isActive: false,
firstName: Like(`%${body.keyword}%`),
},
relations: ["posType", "posLevel", "current_holders"],
@ -4011,7 +4012,7 @@ export class ProfileEmployeeTempController extends Controller {
case "lastname":
[findProfile, total] = await this.profileRepo.findAndCount({
where: {
keycloak: IsNull(),
isActive: false,
lastName: Like(`%${body.keyword}%`),
},
relations: ["posType", "posLevel", "current_holders"],
@ -4023,7 +4024,7 @@ export class ProfileEmployeeTempController extends Controller {
default:
[findProfile, total] = await this.profileRepo.findAndCount({
where: {
keycloak: IsNull(),
isActive: false,
},
relations: ["posType", "posLevel", "current_holders"],
skip,