Skip to content

Commit

Permalink
Fix 404 for orders
Browse files Browse the repository at this point in the history
  • Loading branch information
w3bdesign committed Nov 21, 2024
1 parent 11c90ba commit 742d874
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions backend/src/orders/orders.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ export class OrdersService {
}

async findAll(): Promise<Order[]> {
const orders = await this.orderRepository.find({
return this.orderRepository.find({
relations: ['booking', 'booking.customer', 'booking.employee', 'booking.service'],
order: {
completedAt: 'DESC',
},
});

if (!orders.length) {
throw new NotFoundException('No completed orders found');
}

return orders;
}

async findOne(id: string): Promise<Order> {
Expand Down

0 comments on commit 742d874

Please sign in to comment.