From 5edcb127f9bbaa49f9e0b40db293b1b14748a254 Mon Sep 17 00:00:00 2001 From: Bright Date: Tue, 11 Feb 2025 13:14:33 +0700 Subject: [PATCH] fix --- src/controllers/CommandController.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index ac850cb2..5670d395 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -4707,15 +4707,17 @@ export class CommandController extends Controller { if (!profile) { throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); } + const orgRevision = await this.orgRevisionRepository.findOne({ + where: { + orgRevisionIsCurrent: true, + orgRevisionIsDraft: false + } + }); const _posMaster = await this.employeePosMasterRepository.findOne({ - where: { - orgRevision: { - orgRevisionIsCurrent: true, - orgRevisionIsDraft: false, - }, - current_holderId: profile.id, + where: { + orgRevisionId: orgRevision?.id, + current_holderId: profile.id }, - order: { createdAt: "DESC" }, relations: { orgRoot: true, orgChild1: true,