This commit is contained in:
2025-12-07 12:24:03 +03:30
parent 6659a085f9
commit 1dc1eaad9a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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');