Skip to content

Commit

Permalink
return [] instead of raising error (#106)
Browse files Browse the repository at this point in the history
Co-authored-by: NHT <[email protected]>
  • Loading branch information
nfesta2023 and hoangtuan910 authored Apr 9, 2024
1 parent 4cebb8e commit 872a5e6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/feature/food/food.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,11 @@ export class FoodService {

// Check if there is no sidedish for this main dish
if (sideDishesIds.length === 0) {
res.statusCode = 404;
res.message = 'No side dishes found';
// res.statusCode = 404;
// res.message = 'No side dishes found';
res.statusCode = 200;
res.message = 'Get side dishes successfully';
res.data = [];
return res;
}

Expand Down Expand Up @@ -834,7 +837,8 @@ export class FoodService {

// Check if there is no side dish for this main dish
if (menuItemIds.length === 0) {
throw new HttpException('No food found', HttpStatus.NOT_FOUND);
// throw new HttpException('No food found', HttpStatus.NOT_FOUND);
return [];
}

//Get main dish schedule
Expand Down

0 comments on commit 872a5e6

Please sign in to comment.