update
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user