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