update
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
FahrzeugBuchung,
|
||||
Fahrzeug,
|
||||
CreateBuchungInput,
|
||||
MaintenanceWindow,
|
||||
} from '../types/booking.types';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -22,15 +23,22 @@ export const bookingApi = {
|
||||
// Calendar / listing
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
getCalendarRange(from: Date, to: Date, fahrzeugId?: string): Promise<FahrzeugBuchungListItem[]> {
|
||||
getCalendarRange(
|
||||
from: Date,
|
||||
to: Date,
|
||||
fahrzeugId?: string
|
||||
): Promise<{ bookings: FahrzeugBuchungListItem[]; maintenanceWindows: MaintenanceWindow[] }> {
|
||||
return api
|
||||
.get<ApiResponse<FahrzeugBuchungListItem[]>>('/api/bookings/calendar', {
|
||||
params: {
|
||||
from: from.toISOString(),
|
||||
to: to.toISOString(),
|
||||
...(fahrzeugId ? { fahrzeugId } : {}),
|
||||
},
|
||||
})
|
||||
.get<ApiResponse<{ bookings: FahrzeugBuchungListItem[]; maintenanceWindows: MaintenanceWindow[] }>>(
|
||||
'/api/bookings/calendar',
|
||||
{
|
||||
params: {
|
||||
from: from.toISOString(),
|
||||
to: to.toISOString(),
|
||||
...(fahrzeugId ? { fahrzeugId } : {}),
|
||||
},
|
||||
}
|
||||
)
|
||||
.then((r) => r.data.data);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user