Compare commits

...

2 commits

Author SHA1 Message Date
047845155e Preventing a CancellationError from stopping reservation cancellation 2026-07-24 11:36:52 +02:00
9059f0071f Linter fixes 2026-07-24 11:36:24 +02:00
2 changed files with 9 additions and 7 deletions

View file

@ -62,9 +62,7 @@ export class NtfyProvider implements OnApplicationBootstrap {
async sendBootstrappedNotification() {
const version =
this.configService.get<string>('GIT_COMMIT') ??
(this.configService.get('LOCAL') === 'true'
? 'LOCAL'
: 'unknown')
(this.configService.get('LOCAL') === 'true' ? 'LOCAL' : 'unknown')
await this.publishQueue.add(
...NtfyProvider.defaultJob({
title: 'Autobaan up and running',

View file

@ -112,10 +112,14 @@ export class ReservationsService {
const reservation = await this.getById(id)
if (!reservation) return
if (reservation.status === ReservationStatus.Booked)
await this.brService.cancelReservation(reservation)
else if (reservation.status === ReservationStatus.OnWaitingList)
await this.brService.removeReservationFromWaitList(reservation)
try {
if (reservation.status === ReservationStatus.Booked) {
await this.brService.cancelReservation(reservation)
} else if (reservation.status === ReservationStatus.OnWaitingList) {
await this.brService.removeReservationFromWaitList(reservation)
}
} catch (error: unknown) {}
return await this.reservationsRepository.delete({ id: reservation.id })
}
}