Merge branch 'develop' into adiDev

This commit is contained in:
AdisakKanthawilang 2025-08-25 10:29:05 +07:00
commit b383699c8c

View file

@ -1430,15 +1430,15 @@ export class PositionController extends Controller {
}), }),
); );
if (posMaster.orgRevision?.orgRevisionIsDraft != false) { if (posMaster.orgRevision?.orgRevisionIsCurrent == true) {
const _position = posMaster.positions.find((p) => p.positionIsSelected == true); const _position = requestBody.positions.find((p) => p.positionIsSelected == true);
if (_position) { if (_position) {
const current_holderId: any = posMaster.current_holderId; const current_holderId: any = posMaster.current_holderId;
const _profile = await this.profileRepository.findOne({ const _profile = await this.profileRepository.findOne({
where: { id: current_holderId }, where: { id: current_holderId },
}); });
if (_profile) { if (_profile) {
_profile.position = _position.positionName; _profile.position = _position.posDictName ?? _null;
_profile.posTypeId = _position.posTypeId; _profile.posTypeId = _position.posTypeId;
_profile.posLevelId = _position.posLevelId; _profile.posLevelId = _position.posLevelId;
await this.profileRepository.save(_profile); await this.profileRepository.save(_profile);