[NOT FULLY WORKING] Added frontend react native interface.

This commit is contained in:
c-d-p
2025-04-17 17:28:19 +02:00
parent 4f3946d1c3
commit bf7eb8275c
36 changed files with 12230 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import apiClient from './client';
import { CalendarEvent } from '../types/calendar';
export const getCalendarEvents = async (start?: Date, end?: Date): Promise<CalendarEvent[]> => {
try {
const params: Record<string, string> = {};
if (start instanceof Date) {
params.start = start.toISOString();
}
if (end instanceof Date) {
params.end = end.toISOString();
}
const response = await apiClient.get('/calendar/events', { params });
return response.data;
} catch (error) {
console.error("Error fetching calendar events", error);
throw error;
}
}