fix: processWorkflowStep format cal event (#23802)
* fix: processWorkflowStep format cal event * chore: update platform libraries
This commit is contained in:
1 parent
1fee90322d
commit
794c99239a
4 files changed
+22
-8
No files matched your search
@@ -1,10 +1,11 @@
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { cloneDeep } from "lodash";
|
||||
|
||||
import type { ExtendedCalendarEvent } from "@calcom/ee/workflows/lib/reminders/reminderScheduler";
|
||||
import type { CalendarEvent } from "@calcom/types/Calendar";
|
||||
|
||||
// format CalEvent to remove platformClientId from email addresses
|
||||
const formatClientIdFromEmails = (calEvent: CalendarEvent, clientId: string) => {
|
||||
const formatClientIdFromEmails = (calEvent: CalendarEvent | ExtendedCalendarEvent, clientId: string) => {
|
||||
const attendees = calEvent.attendees.map((attendee) => ({
|
||||
...attendee,
|
||||
email: attendee.email.replace(`+${clientId}`, ""),
|
||||
@@ -25,3 +26,13 @@ export const formatCalEvent = (calEvent: CalendarEvent) => {
|
||||
|
||||
return clonedEvent;
|
||||
};
|
||||
|
||||
export const formatCalEventExtended = (calEvent: ExtendedCalendarEvent) => {
|
||||
const clonedEvent = cloneDeep(calEvent);
|
||||
if (clonedEvent.platformClientId) {
|
||||
const [attendees, organizer] = formatClientIdFromEmails(clonedEvent, clonedEvent.platformClientId);
|
||||
Object.assign(clonedEvent, { attendees, organizer });
|
||||
}
|
||||
|
||||
return clonedEvent;
|
||||
};
|
||||
Reference in new issue
Block a user