This commit is contained in:
Matthias Hochmeister
2026-03-16 12:11:32 +01:00
parent 8d03c13bee
commit 5f329bb5c1
4 changed files with 17 additions and 5 deletions

View File

@@ -277,7 +277,8 @@ function FahrzeugBuchungen() {
setDetailBooking(null);
loadData();
} catch (e: unknown) {
const msg = e instanceof Error ? e.message : 'Fehler beim Stornieren';
const axiosErr = e as { response?: { data?: { message?: string } }; message?: string };
const msg = axiosErr?.response?.data?.message || (e instanceof Error ? e.message : 'Fehler beim Stornieren');
notification.showError(msg);
} finally {
setCancelLoading(false);

View File

@@ -90,7 +90,7 @@ export const bookingApi = {
cancel(id: string, abgesagt_grund: string): Promise<void> {
return api
.delete(`/api/bookings/${id}`, { data: { abgesagt_grund } })
.patch(`/api/bookings/${id}/cancel`, { abgesagt_grund })
.then(() => undefined);
},