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() { async sendBootstrappedNotification() {
const version = const version =
this.configService.get<string>('GIT_COMMIT') ?? this.configService.get<string>('GIT_COMMIT') ??
(this.configService.get('LOCAL') === 'true' (this.configService.get('LOCAL') === 'true' ? 'LOCAL' : 'unknown')
? 'LOCAL'
: 'unknown')
await this.publishQueue.add( await this.publishQueue.add(
...NtfyProvider.defaultJob({ ...NtfyProvider.defaultJob({
title: 'Autobaan up and running', title: 'Autobaan up and running',

View file

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