From 9e177679a81922e2ac86bda123cf32e110d23450 Mon Sep 17 00:00:00 2001 From: mfadiln2018 Date: Tue, 24 May 2022 22:33:14 +0700 Subject: [PATCH] Fix: bug filter get product by categories --- src/product/product.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/product/product.service.ts b/src/product/product.service.ts index a17f617..b427541 100644 --- a/src/product/product.service.ts +++ b/src/product/product.service.ts @@ -344,6 +344,7 @@ export class ProductService { 'product.name', 'product.code', 'product.type', + 'product.status', 'sub_categories.name', 'current_price.admin_price as admin_price', 'current_price.mark_up_price as markup_price', @@ -368,7 +369,9 @@ export class ProductService { if (subCategories && filterSubCategories.length > 0) { baseQuery.where('product.sub_categories_id IN (:...subCategoryId)', { subCategoryId: filterSubCategories, - }); + }).where(`product.status = 'ACTIVE'`) + + ; } const newData = []