[#] added alert when importing events with error

This commit is contained in:
Camille Moussu
2025-07-07 17:31:31 +02:00
parent 7e7043b47e
commit 2a1af0b9f5
6 changed files with 54 additions and 6 deletions
+7 -2
View File
@@ -5,7 +5,8 @@ type RawEntry = [string, Record<string, string>, string, any];
export function parseCalendarEvent(
data: RawEntry[],
color: string
color: string,
calendarid: string
): CalendarEvent {
const event: Partial<CalendarEvent> = { color, attendee: [] };
@@ -64,7 +65,11 @@ export function parseCalendarEvent(
}
if (!event.uid || !event.start) {
throw new Error(`Missing required event fields`);
console.error(
`missing crucial event param in calendar ${calendarid} `,
data
);
event.error = `missing crucial event param in calendar ${calendarid} `;
}
return event as CalendarEvent;