insert position to profile
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m8s

This commit is contained in:
Adisak 2026-04-20 16:01:38 +07:00
parent 28b5408d5b
commit f1c8ecf699
3 changed files with 35 additions and 28 deletions

View file

@ -3829,6 +3829,9 @@ export class PositionController extends Controller {
relations: ["posExecutive"],
});
if (_position) {
// อัพเดท org และ posMasterNo ตลอดไม่ต้องดัก isSit
_profile.posMasterNo = getPosMasterNo(dataMaster);
_profile.org = getOrgFullName(dataMaster);
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
if(!dataMaster.isSit){
_profile.position = _position.positionName;
@ -3838,11 +3841,9 @@ export class PositionController extends Controller {
_profile.posExecutive = _position.posExecutive?.posExecutiveName ?? undefined;
_profile.positionArea = _position.positionArea ?? undefined;
_profile.positionExecutiveField = _position.positionExecutiveField ?? undefined;
_profile.posMasterNo = getPosMasterNo(dataMaster);
_profile.org = getOrgFullName(dataMaster);
await this.profileRepository.save(_profile);
setLogDataDiff(request, { before, after: _profile });
}
await this.profileRepository.save(_profile);
setLogDataDiff(request, { before, after: _profile });
}
}
dataMaster.current_holderId = requestBody.profileId;