From 1b55f82e45487d48ea3e33a874cd5c4d40a63f42 Mon Sep 17 00:00:00 2001 From: Camille Moussu Date: Thu, 3 Jul 2025 17:04:11 +0200 Subject: [PATCH] added ? to colors in calendar and changed the api calls to get all personnal calendars --- src/features/Calendars/CalendarApi.ts | 2 +- src/features/Calendars/CalendarSlice.ts | 2 -- src/features/Calendars/CalendarTypes.ts | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/features/Calendars/CalendarApi.ts b/src/features/Calendars/CalendarApi.ts index 2aca655..b4ab247 100644 --- a/src/features/Calendars/CalendarApi.ts +++ b/src/features/Calendars/CalendarApi.ts @@ -16,7 +16,7 @@ export async function getCalendars(userId: string, opaque_token: string) { export async function getCalendar(id: string, opaque_token: string) { const response = await fetch( - `${process.env.PUBLIC_CALENDAR_BASE_URL}/dav/calendars/${id}/${id}.json`, + `${process.env.PUBLIC_CALENDAR_BASE_URL}/dav/calendars/${id}.json`, { method: "REPORT", headers: { diff --git a/src/features/Calendars/CalendarSlice.ts b/src/features/Calendars/CalendarSlice.ts index cb4467e..03d5705 100644 --- a/src/features/Calendars/CalendarSlice.ts +++ b/src/features/Calendars/CalendarSlice.ts @@ -21,11 +21,9 @@ export const getCalendarsAsync = createAsyncThunk< ? cal["calendarserver:source"]._links.self.href .replace("/calendars/", "") .replace(".json", "") - .split("/")[0] : cal._links.self.href .replace("/calendars/", "") .replace(".json", "") - .split("/")[0]; const color = cal["apple:color"]; const calendarDetails = await getCalendar(id, access_token); diff --git a/src/features/Calendars/CalendarTypes.ts b/src/features/Calendars/CalendarTypes.ts index 363460f..25fed48 100644 --- a/src/features/Calendars/CalendarTypes.ts +++ b/src/features/Calendars/CalendarTypes.ts @@ -4,7 +4,7 @@ export interface Calendars { id: string; name: string; prodid?: string; - color: string; + color?: string; description?: string; calscale?: string; version?: string;