fixed bug
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m4s

This commit is contained in:
Warunee Tamkoo 2026-05-23 00:30:57 +07:00
parent e0f2513ba4
commit 61a09acbad

View file

@ -3754,7 +3754,7 @@ export class CommandController extends Controller {
if (positionOld != null) {
logPositionIsSelectedChange(positionOld.id, positionOld.positionIsSelected, false, {
posMasterId: posMasterOld?.id,
userId: request.user.sub,
userId: req.user.sub,
endpoint: "updateMaster",
action: "command_change_reset_old_position",
});
@ -3765,19 +3765,19 @@ export class CommandController extends Controller {
const checkPosition = await this.positionRepository.find({
where: {
posMasterId: posMaster.id, // ใช้ posMaster ตัวใหม่ (ที่อาจจะเปลี่ยนจาก ancestorDNA)
posMasterId: posMaster!.id, // ใช้ posMaster ตัวใหม่ (ที่อาจจะเปลี่ยนจาก ancestorDNA)
positionIsSelected: true,
},
});
if (checkPosition.length > 0) {
console.log(
`[positionIsSelected-DEBUG] Command change: clearing ${checkPosition.length} positions (posMasterId: ${posMaster.id}, userId: ${request.user.sub}, endpoint: updateMaster)`
`[positionIsSelected-DEBUG] Command change: clearing ${checkPosition.length} positions (posMasterId: ${posMaster!.id}, userId: ${req.user.sub}, endpoint: updateMaster)`
);
const clearPosition = checkPosition.map((positions) => {
logPositionIsSelectedChange(positions.id, positions.positionIsSelected, false, {
posMasterId: posMaster.id,
userId: request.user.sub,
posMasterId: posMaster!.id,
userId: req.user.sub,
endpoint: "updateMaster",
action: "command_change_clear_positions",
});