From 61a09acbad68e5dc2199be3c94ad37a76d8de623 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Sat, 23 May 2026 00:30:57 +0700 Subject: [PATCH] fixed bug --- src/controllers/CommandController.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index e164f973..f4e335ce 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -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", });