This commit is contained in:
AdisakKanthawilang 2024-03-04 15:29:09 +07:00
parent 131246f824
commit df752bed74

View file

@ -1453,7 +1453,7 @@ export class PositionController extends Controller {
where: { id: In(requestBody.positionMaster) },
});
posMasters.forEach(async (posMaster: any) => {
posMasters.forEach(async (posMaster: any, index: number) => {
posMaster.orgRootId = null;
posMaster.orgChild1Id = null;
posMaster.orgChild2Id = null;
@ -1576,8 +1576,8 @@ export class PositionController extends Controller {
const maxPosMasterOrder = Math.max(...allLastPosMasterNo.map((pos) => pos.posMasterOrder), 0);
posMaster.posMasterNo = maxPosMasterNo + 1;
posMaster.posMasterOrder = maxPosMasterOrder + 1;
posMaster.posMasterNo = maxPosMasterNo + index + 1;
posMaster.posMasterOrder = maxPosMasterOrder + index + 1;
posMaster.createdUserId = request.user.sub;
posMaster.createdFullName = request.user.name;
posMaster.lastUpdateUserId = request.user.sub;