diff --git a/src/feature/cart/cart.controller.ts b/src/feature/cart/cart.controller.ts index 5b5bc7b..9bce96d 100644 --- a/src/feature/cart/cart.controller.ts +++ b/src/feature/cart/cart.controller.ts @@ -331,7 +331,12 @@ export class CartController { } } catch (error) { if (error instanceof HttpException) { - res.statusCode = error.getStatus(); + if (error.getStatus() == 404) { + res.statusCode = 400; + } else { + res.statusCode = error.getStatus(); + } + res.message = error.getResponse(); res.data = null; } else { diff --git a/src/feature/cart/cart.service.ts b/src/feature/cart/cart.service.ts index 369d656..8562ab9 100644 --- a/src/feature/cart/cart.service.ts +++ b/src/feature/cart/cart.service.ts @@ -655,7 +655,7 @@ export class CartService { //Check if menu_item_ids do exist if (menuItems.length != menu_item_ids.length) { - throw new HttpException('Some of menu items do not exist', 404); + throw new HttpException('Some of menu items do not exist', 400); } //Check if menu_item_ids belong to the same restaurant