order
This commit is contained in:
@@ -43,7 +43,7 @@ export class OrdersController {
|
|||||||
@ApiOperation({ summary: 'Cancel an order By User' })
|
@ApiOperation({ summary: 'Cancel an order By User' })
|
||||||
@ApiParam({ name: 'id', description: 'Order ID' })
|
@ApiParam({ name: 'id', description: 'Order ID' })
|
||||||
cancelOrder(@Param('id') id: string, @RestId() restId: string) {
|
cancelOrder(@Param('id') id: string, @RestId() restId: string) {
|
||||||
return this.ordersService.cancelOrder(id, restId);
|
return this.ordersService.cancelOrderAsUser(id, restId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@UseGuards(AdminAuthGuard)
|
@UseGuards(AdminAuthGuard)
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ export class OrdersService {
|
|||||||
return order;
|
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 } });
|
const order = await this.em.findOne(Order, { id: orderId, restaurant: { id: restId } });
|
||||||
if (!order) {
|
if (!order) {
|
||||||
throw new NotFoundException('Order not found');
|
throw new NotFoundException('Order not found');
|
||||||
|
|||||||
Reference in New Issue
Block a user