diff --git a/src/reservations/controller.ts b/src/reservations/controller.ts index 47e8004..d96ced2 100644 --- a/src/reservations/controller.ts +++ b/src/reservations/controller.ts @@ -57,9 +57,9 @@ export class ReservationsController { }), ) async createReservation(@Body() reservation: Reservation) { + await this.reservationsService.create(reservation) if (!reservation.isAvailableForReservation()) { this.loggerService.debug('Reservation not available for reservation') - await this.reservationsService.create(reservation) return 'Reservation saved' } this.loggerService.debug('Reservation is available for reservation')