This commit is contained in:
2025-12-06 10:47:13 +03:30
parent 8336e7f81a
commit 803e56f0d3
3 changed files with 118 additions and 3 deletions
+9 -2
View File
@@ -252,8 +252,15 @@ export class OrdersService {
});
}
findOne(id: number) {
return `This action returns a #${id} order`;
async findOne(id: string): Promise<Order> {
const order = await this.orderRepository.findOne(
{ id },
{ populate: ['user', 'restaurant', 'deliveryMethod', 'address', 'paymentMethod', 'items', 'items.food'] },
);
if (!order) {
throw new NotFoundException('Order not found');
}
return order;
}
async acceptOrder(orderId: string) {