File tree Expand file tree Collapse file tree
packages/features/ee/round-robin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { prisma } from "@calcom/prisma";
1313import type { DestinationCalendar } from "@calcom/prisma/client" ;
1414import type { Prisma } from "@calcom/prisma/client" ;
1515import type { CalendarEvent , AdditionalInformation } from "@calcom/types/Calendar" ;
16+ import getICalUID from "@calcom/emails/lib/getICalUID" ;
1617
1718type InitParams = {
1819 user : {
@@ -163,9 +164,16 @@ export const handleRescheduleEventManager = async ({
163164
164165 const calendarResult = results . find ( ( result ) => result . type . includes ( "_calendar" ) ) ;
165166
166- evt . iCalUID = Array . isArray ( calendarResult ?. updatedEvent )
167- ? calendarResult ?. updatedEvent [ 0 ] ?. iCalUID || bookingICalUID
168- : calendarResult ?. updatedEvent ?. iCalUID || bookingICalUID || undefined ;
167+ if ( changedOrganizer ) {
168+ const providerICalUID = evt . iCalUID = Array . isArray ( calendarResult ?. createdEvent )
169+ ? calendarResult ?. createdEvent [ 0 ] ?. iCalUID
170+ : calendarResult ?. createdEvent ?. iCalUID ;
171+ evt . iCalUID = providerICalUID || getICalUID ( { } ) ;
172+ } else {
173+ evt . iCalUID = Array . isArray ( calendarResult ?. updatedEvent )
174+ ? calendarResult ?. updatedEvent [ 0 ] ?. iCalUID || bookingICalUID
175+ : calendarResult ?. updatedEvent ?. iCalUID || bookingICalUID || undefined ;
176+ }
169177 }
170178
171179 const newReferencesToCreate = structuredClone ( updateManager . referencesToCreate ) ;
You can’t perform that action at this time.
0 commit comments