Fondation
This commit is contained in:
parent
6c77a33c6f
commit
b1dacb71cb
@ -230,12 +230,14 @@ export async function fetchCalDAVEvents(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Validate response data exists
|
// Validate response data exists
|
||||||
if (!response.data || typeof response.data !== 'string') {
|
// Handle both Response and ResponseDataDetailed types
|
||||||
throw new Error(`Invalid response from CalDAV server: expected string data, got ${typeof response.data}`);
|
const responseData = (response as any).data || '';
|
||||||
|
if (!responseData || typeof responseData !== 'string') {
|
||||||
|
throw new Error(`Invalid response from CalDAV server: expected string data, got ${typeof responseData}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse iCalendar data from response
|
// Parse iCalendar data from response
|
||||||
const events = parseICalendarEvents(response.data);
|
const events = parseICalendarEvents(responseData);
|
||||||
|
|
||||||
return events;
|
return events;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user