Changing creation of reservation to always save a reservation and instead delete when it has been reserved
This commit is contained in:
parent
fd5d059992
commit
56d1095f1f
1 changed files with 1 additions and 1 deletions
|
|
@ -57,9 +57,9 @@ export class ReservationsController {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
async createReservation(@Body() reservation: Reservation) {
|
async createReservation(@Body() reservation: Reservation) {
|
||||||
|
await this.reservationsService.create(reservation)
|
||||||
if (!reservation.isAvailableForReservation()) {
|
if (!reservation.isAvailableForReservation()) {
|
||||||
this.loggerService.debug('Reservation not available for reservation')
|
this.loggerService.debug('Reservation not available for reservation')
|
||||||
await this.reservationsService.create(reservation)
|
|
||||||
return 'Reservation saved'
|
return 'Reservation saved'
|
||||||
}
|
}
|
||||||
this.loggerService.debug('Reservation is available for reservation')
|
this.loggerService.debug('Reservation is available for reservation')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue