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");