clear cart
This commit is contained in:
@@ -83,6 +83,13 @@ export class CartController {
|
||||
return this.cartService.removeItem(userId, restaurantId, foodId);
|
||||
}
|
||||
|
||||
@Delete()
|
||||
@ApiOperation({ summary: 'Clear entire cart' })
|
||||
@ApiResponse({ status: 200, description: 'Cart cleared successfully' })
|
||||
async clearCart(@UserId() userId: string, @RestId() restaurantId: string) {
|
||||
return this.cartService.clearCart(userId, restaurantId);
|
||||
}
|
||||
|
||||
@Post('apply-coupon')
|
||||
@ApiOperation({ summary: 'Apply coupon to cart' })
|
||||
@ApiBody({ type: ApplyCouponDto })
|
||||
|
||||
@@ -71,6 +71,10 @@ export class CartService {
|
||||
}
|
||||
return cart;
|
||||
}
|
||||
async findOne2(userId: string, restaurantId: string): Promise<Cart | null> {
|
||||
const cart = await this.getCartByRestaurant(userId, restaurantId);
|
||||
return cart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add item to cart (increment quantity if item exists, otherwise create new)
|
||||
|
||||
Reference in New Issue
Block a user