fix: get product all

This commit is contained in:
ilham 2021-12-17 02:00:07 +07:00
parent c5b5a4ab06
commit 5da48273c0
2 changed files with 2 additions and 20 deletions

View File

@ -69,7 +69,7 @@ export class ProductController {
};
}
@Get('get-all')
@Get('all')
async findAll(
@Query('page') page: number,
@Query('sub-category') subcategory: string,
@ -179,24 +179,6 @@ export class ProductController {
};
}
@Get('categories/:id')
async findOneCategories(@Param('id', ParseUUIDPipe) id: string) {
return {
data: await this.productCategoriesService.findOne(id),
statusCode: HttpStatus.OK,
message: 'success',
};
}
@Get('sub-categories/:id')
async findOneSubCategories(@Param('id', ParseUUIDPipe) id: string) {
return {
data: await this.productSubCategoriesService.findOne(id),
statusCode: HttpStatus.OK,
message: 'success',
};
}
@Put(':id')
async update(
@Param('id', ParseUUIDPipe) id: string,

View File

@ -54,7 +54,7 @@ export class ProductService {
}
async findAll(page, supplier, categories, subCategories) {
if (supplier != 'null' && !supplier) {
if (supplier == 'null' || !supplier) {
supplier = (await this.supplierService.findByActive()).id;
}
const baseQuery = this.productRepository