Fetch only CalDAV calendars via TSDav (#1727)

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
This commit is contained in:
Bailey Pumfleet 2022-02-08 14:56:49 +00:00 committed by GitHub
parent 2ec0673e3d
commit ce3947ac4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -191,19 +191,21 @@ export default abstract class BaseCalendarService implements Calendar {
): Promise<EventBusyDate[]> {
const objects = (
await Promise.all(
selectedCalendars.map((sc) =>
fetchCalendarObjects({
calendar: {
url: sc.externalId,
},
headers: this.headers,
expand: true,
timeRange: {
start: new Date(dateFrom).toISOString(),
end: new Date(dateTo).toISOString(),
},
})
)
selectedCalendars
.filter((sc) => sc.integration === "caldav_calendar")
.map((sc) =>
fetchCalendarObjects({
calendar: {
url: sc.externalId,
},
headers: this.headers,
expand: true,
timeRange: {
start: new Date(dateFrom).toISOString(),
end: new Date(dateTo).toISOString(),
},
})
)
)
).flat();