This commit is contained in:
2025-12-11 18:22:18 +03:30
parent 10b0bfe554
commit 2cf554caa4
12 changed files with 13 additions and 76 deletions
@@ -8,7 +8,7 @@ import { SetPaymentMethodDto } from '../dto/set-payment-method.dto';
import { SetDeliveryMethodDto } from '../dto/set-delivery-method.dto';
import { SetDescriptionDto } from '../dto/set-description.dto';
import { SetTableNumberDto } from '../dto/set-table-number.dto';
import { ApiTags, ApiOperation, ApiResponse, ApiBearerAuth, ApiBody, ApiParam } from '@nestjs/swagger';
import { ApiTags, ApiOperation, ApiBearerAuth, ApiBody, ApiParam } from '@nestjs/swagger';
import { AuthGuard } from '../../auth/guards/auth.guard';
import { UserId } from 'src/common/decorators/user-id.decorator';
import { RestId } from 'src/common/decorators/rest-id.decorator';
@@ -67,15 +67,12 @@ export class CartController {
@Delete('items/:foodId')
@ApiOperation({ summary: 'Remove item from cart' })
@ApiParam({ name: 'foodId', description: 'Food ID in the cart' })
@ApiResponse({ status: 200, description: 'Item removed from cart successfully' })
@ApiResponse({ status: 404, description: 'Item not found in cart' })
async removeItem(@UserId() userId: string, @RestId() restaurantId: string, @Param('foodId') foodId: string) {
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);
}
@@ -89,7 +86,6 @@ export class CartController {
@Delete('coupon')
@ApiOperation({ summary: 'Remove coupon from cart' })
@ApiResponse({ status: 200, description: 'Coupon removed successfully' })
async removeCoupon(@UserId() userId: string, @RestId() restaurantId: string) {
return this.cartService.removeCoupon(userId, restaurantId);
}