save profile before add his

This commit is contained in:
mamoss 2025-09-02 22:52:11 +07:00
parent 577a413ffa
commit f1436d1485
4 changed files with 25 additions and 24 deletions

View file

@ -2451,6 +2451,7 @@ export class EmployeePositionController extends Controller {
await CreatePosMasterHistoryEmployee(posMasterOld.id, request);
}
await this.employeePosMasterRepository.save(posMaster);
await CreatePosMasterHistoryEmployee(posMaster.id, request);
const positionNew = await this.employeePositionRepository.findOne({
where: {
@ -2471,7 +2472,6 @@ export class EmployeePositionController extends Controller {
await this.profileRepository.save(profile);
await this.employeePositionRepository.save(positionNew);
}
await CreatePosMasterHistoryEmployee(posMaster.id, request);
return new HttpSuccess();
}