From 0338ba48d1f3ba98428a9d19f0e51e0abfc0e66d Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Mon, 16 Dec 2024 17:39:27 +0700 Subject: [PATCH] #857 (3) --- src/controllers/OrganizationUnauthorizeController.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/controllers/OrganizationUnauthorizeController.ts b/src/controllers/OrganizationUnauthorizeController.ts index a637fdea..216e2f8f 100644 --- a/src/controllers/OrganizationUnauthorizeController.ts +++ b/src/controllers/OrganizationUnauthorizeController.ts @@ -666,7 +666,8 @@ export class OrganizationUnauthorizeController extends Controller { .leftJoinAndSelect("current_holders.orgChild4", "orgChild4") .leftJoinAndSelect("current_holders.positions", "positions") .leftJoinAndSelect("positions.posExecutive", "posExecutive") - .where({ citizenId: id }) + .where("current_holders.orgRevisionId = :orgRevisionId", { orgRevisionId: findRevision.id }) + .andWhere({ citizenId: id }) .getOne(); if (!findProfile) { throw new HttpError(HttpStatusCode.NOT_FOUND, "not found Profile"); @@ -872,8 +873,9 @@ export class OrganizationUnauthorizeController extends Controller { .leftJoinAndSelect("current_holders.orgChild3", "orgChild3") .leftJoinAndSelect("current_holders.orgChild4", "orgChild4") .leftJoinAndSelect("current_holders.positions", "positions") + .where("current_holders.orgRevisionId = :orgRevisionId", { orgRevisionId: findRevision.id }) // .leftJoinAndSelect("positions.posExecutive", "posExecutive") - .where({ citizenId: id, employeeClass: "PERM" }) + .andWhere({ citizenId: id, employeeClass: "PERM" }) .getOne(); if (!findProfile) { throw new HttpError(HttpStatusCode.NOT_FOUND, "not found Profile");