comment update dna(keycloak) when command

This commit is contained in:
Adisak 2026-03-09 16:17:26 +07:00
parent 060ac81532
commit 5102805278

View file

@ -4257,12 +4257,12 @@ export class CommandController extends Controller {
}
await this.profileRepository.save(profile);
if (profile.id) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[profile.id],
"PROFILE",
);
}
// if (profile.id) {
// await this.keycloakAttributeService.clearOrgDnaAttributes(
// [profile.id],
// "PROFILE",
// );
// }
// update user attribute in keycloak
await updateUserAttributes(profile.keycloak ?? "", {
@ -4511,12 +4511,12 @@ export class CommandController extends Controller {
}
await this.profileEmployeeRepository.save(profile);
if (profile.id) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[profile.id],
"PROFILE_EMPLOYEE",
);
}
// if (profile.id) {
// await this.keycloakAttributeService.clearOrgDnaAttributes(
// [profile.id],
// "PROFILE_EMPLOYEE",
// );
// }
// Task #2190
if (code && ["C-PM-23", "C-PM-43"].includes(code)) {
@ -4734,12 +4734,12 @@ export class CommandController extends Controller {
profile.amountSpecial = item.amountSpecial ?? _null;
await this.profileRepository.save(profile, { data: req });
if (profile.id) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[profile.id],
"PROFILE",
);
}
// if (profile.id) {
// await this.keycloakAttributeService.clearOrgDnaAttributes(
// [profile.id],
// "PROFILE",
// );
// }
}
Object.assign(data, { ...item, ...meta });
const history = new ProfileSalaryHistory();
@ -5224,12 +5224,12 @@ export class CommandController extends Controller {
// _profile.posLevelId = _null;
}
await this.profileRepository.save(_profile);
if (_profile.id) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[_profile.id],
"PROFILE",
);
}
// if (_profile.id) {
// await this.keycloakAttributeService.clearOrgDnaAttributes(
// [_profile.id],
// "PROFILE",
// );
// }
}
}
// ลูกจ้าง
@ -5407,12 +5407,12 @@ export class CommandController extends Controller {
// _profile.posLevelId = _null;
}
await this.profileEmployeeRepository.save(_profile);
if (_profile.id) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[_profile.id],
"PROFILE_EMPLOYEE",
);
}
// if (_profile.id) {
// await this.keycloakAttributeService.clearOrgDnaAttributes(
// [_profile.id],
// "PROFILE_EMPLOYEE",
// );
// }
}
}
// Task #2190
@ -5745,12 +5745,12 @@ export class CommandController extends Controller {
}
await this.profileEmployeeRepository.save(_profile);
if (_profile.id) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[_profile.id],
"PROFILE_EMPLOYEE",
);
}
// if (_profile.id) {
// await this.keycloakAttributeService.clearOrgDnaAttributes(
// [_profile.id],
// "PROFILE_EMPLOYEE",
// );
// }
}
}),
);
@ -6185,12 +6185,12 @@ export class CommandController extends Controller {
this.salaryRepo.save(profileSalary),
]);
if (profile.id) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[profile.id],
"PROFILE",
);
}
// if (profile.id) {
// await this.keycloakAttributeService.clearOrgDnaAttributes(
// [profile.id],
// "PROFILE",
// );
// }
const history = new ProfileSalaryHistory();
Object.assign(history, { ...profileSalary, id: undefined });