feat: rewrite filter for product again

This commit is contained in:
caturbgs 2021-12-22 14:24:03 +07:00
parent d9ca0888e7
commit 15945fa408

View File

@ -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,