update command test

This commit is contained in:
adisak 2025-09-02 10:13:57 +07:00
parent 2bb44003c0
commit f192c4ed0e

View file

@ -3166,12 +3166,6 @@ export class CommandController extends Controller {
posMaster.lastUpdatedAt = new Date();
posMaster.conditionReason = _null;
posMaster.isCondition = false;
if (posMasterOld != null) {
await this.posMasterRepository.save(posMasterOld);
await CreatePosMasterHistoryOfficer(posMasterOld.id, req);
}
await this.posMasterRepository.save(posMaster);
await CreatePosMasterHistoryOfficer(posMaster.id, req);
const positionNew = await this.positionRepository.findOne({
where: {
@ -3189,6 +3183,13 @@ export class CommandController extends Controller {
await this.profileRepository.save(profile);
await this.positionRepository.save(positionNew);
}
if (posMasterOld != null) {
await this.posMasterRepository.save(posMasterOld);
await CreatePosMasterHistoryOfficer(posMasterOld.id, req);
}
await this.posMasterRepository.save(posMaster);
await CreatePosMasterHistoryOfficer(posMaster.id, req);
}),
);