#2345
All checks were successful
Build & Deploy on Dev / build (push) Successful in 3m14s

This commit is contained in:
Adisak 2026-03-09 14:44:38 +07:00
parent 91887ec63d
commit 060ac81532
4 changed files with 201 additions and 123 deletions

View file

@ -44,6 +44,7 @@ import { Assign } from "../entities/Assign";
import { ProfileEmployee } from "../entities/ProfileEmployee";
import { PosMasterHistory } from "../entities/PosMasterHistory";
import { CreatePosMasterHistoryOfficer } from "../services/PositionService";
import { KeycloakAttributeService } from "../services/KeycloakAttributeService";
@Route("api/v1/org/pos")
@Tags("Position")
@Security("bearerAuth")
@ -73,6 +74,7 @@ export class PositionController extends Controller {
private authRoleRepo = AppDataSource.getRepository(AuthRole);
private posMasterAssignRepo = AppDataSource.getRepository(PosMasterAssign);
private assignRepo = AppDataSource.getRepository(Assign);
private keycloakAttributeService = new KeycloakAttributeService();
/**
* API
@ -3868,6 +3870,13 @@ export class PositionController extends Controller {
await CreatePosMasterHistoryOfficer(dataMaster.id, request, "DELETE");
}
if (dataMaster.current_holderId) {
await this.keycloakAttributeService.clearOrgDnaAttributes(
[dataMaster.current_holderId],
"PROFILE",
);
}
let _profileId: string = "";
if (dataMaster?.current_holderId) {
_profileId = dataMaster?.current_holderId;