This commit is contained in:
parent
91887ec63d
commit
060ac81532
4 changed files with 201 additions and 123 deletions
|
|
@ -43,6 +43,7 @@ import permission from "../interfaces/permission";
|
|||
import { setLogDataDiff } from "../interfaces/utils";
|
||||
import { CreatePosMasterHistoryEmployeeTemp } from "../services/PositionService";
|
||||
import { PosMasterEmployeeTempHistory } from "../entities/PosMasterEmployeeTempHistory";
|
||||
import { KeycloakAttributeService } from "../services/KeycloakAttributeService";
|
||||
@Route("api/v1/org/employee-temp/pos")
|
||||
@Tags("Employee")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -65,6 +66,7 @@ export class EmployeeTempPositionController extends Controller {
|
|||
private child3Repository = AppDataSource.getRepository(OrgChild3);
|
||||
private child4Repository = AppDataSource.getRepository(OrgChild4);
|
||||
private authRoleRepo = AppDataSource.getRepository(AuthRole);
|
||||
private keycloakAttributeService = new KeycloakAttributeService();
|
||||
|
||||
/**
|
||||
* API เพิ่มตำแหน่งลูกจ้างประจำ
|
||||
|
|
@ -2141,6 +2143,13 @@ export class EmployeeTempPositionController extends Controller {
|
|||
// }
|
||||
// }
|
||||
|
||||
if (dataMaster.current_holderId) {
|
||||
await this.keycloakAttributeService.clearOrgDnaAttributes(
|
||||
[dataMaster.current_holderId],
|
||||
"PROFILE_EMPLOYEE",
|
||||
);
|
||||
}
|
||||
|
||||
await this.employeeTempPosMasterRepository.update(id, {
|
||||
isSit: false,
|
||||
next_holderId: null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue