From 15945fa408503825601ae035f7f6cee703058e3e Mon Sep 17 00:00:00 2001 From: caturbgs Date: Wed, 22 Dec 2021 14:24:03 +0700 Subject: [PATCH] feat: rewrite filter for product again --- src/product/product.controller.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/product/product.controller.ts b/src/product/product.controller.ts index 52d3c0e..0539d81 100644 --- a/src/product/product.controller.ts +++ b/src/product/product.controller.ts @@ -75,7 +75,11 @@ export class ProductController { @Query('sub-category') subcategory: string, @Query('supplier') supplier: string, ) { - const data = await this.productService.findAll(page, supplier, subcategory); + const data = await this.productService.findAll( + page, + JSON.parse(supplier), + JSON.parse(subcategory), + ); return { ...data, @@ -155,7 +159,10 @@ export class ProductController { @Query('page') page: number, @Query('category') category: string, ) { - const data = await this.productSubCategoriesService.findAll(page, category); + const data = await this.productSubCategoriesService.findAll( + page, + JSON.parse(category), + ); return { ...data,