rework vehicle handling

This commit is contained in:
Matthias Hochmeister
2026-02-28 13:57:41 +01:00
parent 41fc41bee4
commit 1e478479be
12 changed files with 85 additions and 26 deletions

View File

@@ -216,6 +216,9 @@ export const incidentsApi = {
const response = await api.get<{ success: boolean; data: IncidentListResponse }>(
`/api/incidents?${params.toString()}`
);
if (!response.data?.data) {
throw new Error('Invalid API response');
}
return response.data.data;
},
@@ -227,6 +230,9 @@ export const incidentsApi = {
const response = await api.get<{ success: boolean; data: EinsatzStats }>(
`/api/incidents/stats${params}`
);
if (!response.data?.data) {
throw new Error('Invalid API response');
}
return response.data.data;
},
@@ -237,6 +243,9 @@ export const incidentsApi = {
const response = await api.get<{ success: boolean; data: EinsatzDetail }>(
`/api/incidents/${id}`
);
if (!response.data?.data) {
throw new Error('Invalid API response');
}
return response.data.data;
},
@@ -248,6 +257,9 @@ export const incidentsApi = {
'/api/incidents',
payload
);
if (!response.data?.data) {
throw new Error('Invalid API response');
}
return response.data.data;
},
@@ -259,6 +271,9 @@ export const incidentsApi = {
`/api/incidents/${id}`,
payload
);
if (!response.data?.data) {
throw new Error('Invalid API response');
}
return response.data.data;
},