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