From 16058db62c6fdca60e9b0f13895e266d1b64f472 Mon Sep 17 00:00:00 2001 From: caturbgs Date: Wed, 22 Dec 2021 14:34:49 +0700 Subject: [PATCH] feat: rewrite filter for product again --- src/product/product.controller.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/product/product.controller.ts b/src/product/product.controller.ts index 0539d81..f26f7e0 100644 --- a/src/product/product.controller.ts +++ b/src/product/product.controller.ts @@ -77,8 +77,8 @@ export class ProductController { ) { const data = await this.productService.findAll( page, - JSON.parse(supplier), - JSON.parse(subcategory), + supplier == 'null' ? null : supplier, + subcategory == 'null' ? null : subcategory, ); return { @@ -161,7 +161,7 @@ export class ProductController { ) { const data = await this.productSubCategoriesService.findAll( page, - JSON.parse(category), + category == 'null' ? null : category, ); return {