fix: Minimum fix for N Calendar Invites (#14617)

* Remove pushing team member destination calendars

* Only create the event on the first destination calendar

* Only create event on the first destination calendar
This commit is contained in:
Joe Au-Yeung authored and GitHub committed 2024-04-16 20:05:40 +00:00
1 parent e3e464abfa
commit cebbffe230
3 files changed
+28 -1

No files matched your search

@@ -0,0 +1,18 @@
import type { DestinationCalendar } from "@prisma/client";
import { metadata as OutlookMetadata } from "../../office365calendar";
/**
* When inviting attendees to a calendar event, sometimes the external ID is only used for internal purposes
* Need to process the correct external ID for the calendar service
*/
const processExternalId = (destinationCalendar: DestinationCalendar) => {
if (destinationCalendar.integration === OutlookMetadata.type) {
// Primary email should always be present for Outlook
return destinationCalendar.primaryEmail || destinationCalendar.externalId;
}
return destinationCalendar.externalId;
};
export default processExternalId;