fix: get product all
This commit is contained in:
@@ -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,
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user