This commit is contained in:
Matthias Hochmeister
2026-03-16 15:01:09 +01:00
parent 3c72fe627f
commit f3ad989a9e
28 changed files with 794 additions and 52 deletions

View File

@@ -5,6 +5,7 @@ import type {
Veranstaltung,
GroupInfo,
CreateVeranstaltungInput,
ConflictEvent,
} from '../types/events.types';
// ---------------------------------------------------------------------------
@@ -153,4 +154,13 @@ export const eventsApi = {
.post<ApiResponse<{ created: number; errors: string[] }>>('/api/events/import', { events })
.then((r) => r.data.data);
},
/** Check for overlapping events in a time range */
checkConflicts(from: string, to: string, excludeId?: string): Promise<ConflictEvent[]> {
return api
.get<ApiResponse<ConflictEvent[]>>('/api/events/conflicts', {
params: { from, to, ...(excludeId ? { excludeId } : {}) },
})
.then((r) => r.data.data);
},
};