add food title if not exist
This commit is contained in:
@@ -46,7 +46,7 @@ export class CartValidationService {
|
|||||||
validateStock(food: Food, quantity: number): void {
|
validateStock(food: Food, quantity: number): void {
|
||||||
const availableStock = food.inventory!.availableStock;
|
const availableStock = food.inventory!.availableStock;
|
||||||
if (availableStock < quantity) {
|
if (availableStock < quantity) {
|
||||||
throw new BadRequestException(CartMessage.INSUFFICIENT_STOCK);
|
throw new BadRequestException(CartMessage.INSUFFICIENT_STOCK + food.title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user