diff --git a/src/modules/orders/orders.controller.ts b/src/modules/orders/orders.controller.ts index 0b00ec6..dec27da 100644 --- a/src/modules/orders/orders.controller.ts +++ b/src/modules/orders/orders.controller.ts @@ -43,7 +43,7 @@ export class OrdersController { @ApiOperation({ summary: 'Cancel an order By User' }) @ApiParam({ name: 'id', description: 'Order ID' }) cancelOrder(@Param('id') id: string, @RestId() restId: string) { - return this.ordersService.cancelOrder(id, restId); + return this.ordersService.cancelOrderAsUser(id, restId); } @UseGuards(AdminAuthGuard) diff --git a/src/modules/orders/orders.service.ts b/src/modules/orders/orders.service.ts index d4dc1fa..edd74cd 100644 --- a/src/modules/orders/orders.service.ts +++ b/src/modules/orders/orders.service.ts @@ -331,7 +331,7 @@ export class OrdersService { return order; } - async cancelOrder(orderId: string, restId: string) { + async cancelOrderAsUser(orderId: string, restId: string) { const order = await this.em.findOne(Order, { id: orderId, restaurant: { id: restId } }); if (!order) { throw new NotFoundException('Order not found');