From c6d4b123079327f5187d14204c981dda0f9f6d85 Mon Sep 17 00:00:00 2001 From: Fadli Date: Mon, 29 Aug 2022 14:49:01 +0700 Subject: [PATCH] - change status to product history status --- src/product/product.service.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/product/product.service.ts b/src/product/product.service.ts index bae2bef..1afedee 100644 --- a/src/product/product.service.ts +++ b/src/product/product.service.ts @@ -282,8 +282,9 @@ export class ProductService { 'current_price', 'current_price.partner_id is NULL and current_price.end_date is NULL', ) + .leftJoin('product.statusHistory', 'status_history') .where( - `product.supplier_id = :supplier_id and product.status = 'ACTIVE'`, + `product.supplier_id = :supplier_id and status_history.status = 'ACTIVE'`, { supplier_id: supplier, }, @@ -451,7 +452,6 @@ export class ProductService { relations: ['supplier'], where: { code: code, - status: 'ACTIVE', }, }); } catch (e) {