diff --git a/packages/lib/formatCalendarEvent.ts b/packages/lib/formatCalendarEvent.ts index bfdd36301d..a9e8482efe 100644 --- a/packages/lib/formatCalendarEvent.ts +++ b/packages/lib/formatCalendarEvent.ts @@ -14,14 +14,23 @@ const formatClientIdFromEmails = (calEvent: CalendarEvent | ExtendedCalendarEven ...calEvent.organizer, email: calEvent.organizer.email.replace(`+${clientId}`, ""), }; - return [attendees, organizer]; + const team = calEvent.team + ? { + ...calEvent.team, + members: calEvent.team.members.map((member) => ({ + ...member, + email: member.email.replace(`+${clientId}`, ""), + })), + } + : undefined; + return [attendees, organizer, team]; }; export const formatCalEvent = (calEvent: CalendarEvent) => { const clonedEvent = cloneDeep(calEvent); if (clonedEvent.platformClientId) { - const [attendees, organizer] = formatClientIdFromEmails(clonedEvent, clonedEvent.platformClientId); - Object.assign(clonedEvent, { attendees, organizer }); + const [attendees, organizer, team] = formatClientIdFromEmails(clonedEvent, clonedEvent.platformClientId); + Object.assign(clonedEvent, { attendees, organizer, team }); } return clonedEvent; diff --git a/packages/platform/atoms/hooks/useOAuthFlow.ts b/packages/platform/atoms/hooks/useOAuthFlow.ts index d9ff7bed8b..5c01471efa 100644 --- a/packages/platform/atoms/hooks/useOAuthFlow.ts +++ b/packages/platform/atoms/hooks/useOAuthFlow.ts @@ -42,7 +42,7 @@ export const useOAuthFlow = ({ accessToken, refreshUrl, clientId, onError, onSuc setIsRefreshing(false); } - return Promise.reject(err.response); + return Promise.reject(err); }) : "";