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

@@ -11,6 +11,7 @@ import type { Logger } from "tslog";
import { v5 as uuidv5 } from "uuid";
import z from "zod";
import processExternalId from "@calcom/app-store/_utils/calendars/processExternalId";
import { metadata as GoogleMeetMetadata } from "@calcom/app-store/googlevideo/_metadata";
import type { LocationObject } from "@calcom/app-store/locations";
import {
@@ -1405,9 +1406,13 @@ async function handler(
// Organizer or user owner of this event type it's not listed as a team member.
const teamMemberPromises = users.slice(1).map(async (user) => {
// TODO: Add back once EventManager tests are ready https://github.com/calcom/cal.com/pull/14610#discussion_r1567817120
// push to teamDestinationCalendars if it's a team event but collective only
if (isTeamEventType && eventType.schedulingType === "COLLECTIVE" && user.destinationCalendar) {
teamDestinationCalendars.push(user.destinationCalendar);
teamDestinationCalendars.push({
...user.destinationCalendar,
externalId: processExternalId(user.destinationCalendar),
});
}
return {