Files
calendar/packages/app-store/_utils/calendars/processExternalId.ts
T
Joe Au-YeungandGitHub cebbffe230 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
2024-04-16 20:05:40 +00:00

19 lines
678 B
TypeScript

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;