new features
This commit is contained in:
@@ -9,6 +9,7 @@ import type {
|
||||
UpdateFahrzeugPayload,
|
||||
UpdateStatusPayload,
|
||||
CreateWartungslogPayload,
|
||||
UpdateWartungslogPayload,
|
||||
StatusUpdateResponse,
|
||||
} from '../types/vehicle.types';
|
||||
|
||||
@@ -94,6 +95,17 @@ export const vehiclesApi = {
|
||||
return response.data.data;
|
||||
},
|
||||
|
||||
async updateWartungslog(vehicleId: string, wartungId: string, payload: UpdateWartungslogPayload): Promise<FahrzeugWartungslog> {
|
||||
const response = await api.patch<{ success: boolean; data: FahrzeugWartungslog }>(
|
||||
`/api/vehicles/${vehicleId}/wartung/${wartungId}`,
|
||||
payload
|
||||
);
|
||||
if (response.data?.data === undefined || response.data?.data === null) {
|
||||
throw new Error('Invalid API response');
|
||||
}
|
||||
return response.data.data;
|
||||
},
|
||||
|
||||
async exportAlerts(): Promise<Blob> {
|
||||
const response = await api.get('/api/vehicles/alerts/export', {
|
||||
responseType: 'blob',
|
||||
|
||||
Reference in New Issue
Block a user