Events not being added to outlook (#7726)

This commit is contained in:
Keith Williams authored and GitHub committed 2023-03-15 21:04:35 +01:00
1 parent 9568e16ef6
commit 74986bb6a3
1 file changed
+4 -4
@@ -55,11 +55,11 @@ export default class Office365CalendarService implements Calendar {
async createEvent(event: CalendarEvent): Promise<NewCalendarEventType> {
try {
const calendarId = event.destinationCalendar?.externalId
? `${event.destinationCalendar.externalId}/`
: "";
const eventsUrl = event.destinationCalendar?.externalId
? `/me/calendars/${event.destinationCalendar?.externalId}/events`
: "/me/calendar/events";
const response = await this.fetcher(`/me/calendars/${calendarId}events`, {
const response = await this.fetcher(eventsUrl, {
method: "POST",
body: JSON.stringify(this.translateEvent(event)),
});