Skip to content

Commit

Permalink
Fetch only CalDAV calendars via TSDav (calcom#1727)
Browse files Browse the repository at this point in the history
Co-authored-by: Peer Richelsen <[email protected]>
  • Loading branch information
pumfleet and PeerRich authored Feb 8, 2022
1 parent 2ec0673 commit ce3947a
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions lib/integrations/calendar/services/BaseCalendarService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit ce3947a

Please sign in to comment.