fix: Set teamMemberEmail server side for CRM RR Skip (#16367)

Co-authored-by: Keith Williams <[email protected]>
Co-authored-by: zomars <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-08-29 14:16:48 -07:00
1 parent ae55e5e264
commit 3aa6878c27
17 files changed
+140 -114

No files matched your search

@@ -47,7 +47,7 @@ export interface IUseBookings {
hashedLink?: string | null;
bookingForm: UseBookingFormReturnType["bookingForm"];
metadata: Record<string, string>;
teamMemberEmail?: string;
teamMemberEmail?: string | null;
}
const getBookingSuccessfulEventPayload = (booking: {
@@ -310,7 +310,6 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, teamMemb
bookingForm,
hashedLink,
metadata,
teamMemberEmail,
handleInstantBooking: createInstantBookingMutation.mutate,
handleRecBooking: createRecurringBookingMutation.mutate,
handleBooking: createBookingMutation.mutate,
+10 -1
View File
@@ -32,6 +32,7 @@ type StoreInitializeType = {
durationConfig?: number[] | null;
org?: string | null;
isInstantMeeting?: boolean;
teamMemberEmail?: string | null;
};
type SeatedEventData = {
@@ -148,6 +149,8 @@ export type BookerStore = {
org?: string | null;
setOrg: (org: string | null | undefined) => void;
teamMemberEmail?: string | null;
};
/**
@@ -253,6 +256,7 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
durationConfig,
org,
isInstantMeeting,
teamMemberEmail,
}: StoreInitializeType) => {
const selectedDateInStore = get().selectedDate;
@@ -265,7 +269,8 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
get().bookingUid === bookingUid &&
get().bookingData?.responses.email === bookingData?.responses.email &&
get().layout === layout &&
get().rescheduledBy === rescheduledBy
get().rescheduledBy === rescheduledBy &&
get().teamMemberEmail
)
return;
set({
@@ -284,6 +289,7 @@ export const useBookerStore = create<BookerStore>((set, get) => ({
selectedDate:
selectedDateInStore ||
(["week_view", "column_view"].includes(layout) ? dayjs().format("YYYY-MM-DD") : null),
teamMemberEmail,
});
if (durationConfig?.includes(Number(getQueryParam("duration")))) {
@@ -372,6 +378,7 @@ export const useInitializeBookerStore = ({
durationConfig,
org,
isInstantMeeting,
teamMemberEmail,
}: StoreInitializeType) => {
const initializeStore = useBookerStore((state) => state.initialize);
useEffect(() => {
@@ -389,6 +396,7 @@ export const useInitializeBookerStore = ({
verifiedEmail,
durationConfig,
isInstantMeeting,
teamMemberEmail,
});
}, [
initializeStore,
@@ -405,5 +413,6 @@ export const useInitializeBookerStore = ({
verifiedEmail,
durationConfig,
isInstantMeeting,
teamMemberEmail,
]);
};
@@ -85,6 +85,7 @@ export interface BookerProps {
*/
hashedLink?: string | null;
isInstantMeeting?: boolean;
teamMemberEmail?: string | null;
}
export type WrappedBookerPropsMain = {
@@ -65,7 +65,7 @@ export const useScheduleForEvent = ({
dayCount,
selectedDate,
orgSlug,
bookerEmail,
teamMemberEmail,
}: {
prefetchNextMonth?: boolean;
username?: string | null;
@@ -77,7 +77,7 @@ export const useScheduleForEvent = ({
dayCount?: number | null;
selectedDate?: string | null;
orgSlug?: string;
bookerEmail?: string;
teamMemberEmail?: string | null;
} = {}) => {
const { timezone } = useTimePreferences();
const event = useEvent();
@@ -107,7 +107,7 @@ export const useScheduleForEvent = ({
duration: durationFromStore ?? duration,
isTeamEvent: pathname?.indexOf("/team/") !== -1 || isTeam,
orgSlug,
bookerEmail,
teamMemberEmail,
});
return {
@@ -20,7 +20,7 @@ export type BookingOptions = {
bookingUid?: string;
seatReferenceUid?: string;
hashedLink?: string | null;
teamMemberEmail?: string;
teamMemberEmail?: string | null;
orgSlug?: string;
};
@@ -16,7 +16,7 @@ export type UseScheduleWithCacheArgs = {
rescheduleUid?: string | null;
isTeamEvent?: boolean;
orgSlug?: string;
bookerEmail?: string;
teamMemberEmail?: string | null;
};
export const useSchedule = ({
@@ -33,7 +33,7 @@ export const useSchedule = ({
rescheduleUid,
isTeamEvent,
orgSlug,
bookerEmail,
teamMemberEmail,
}: UseScheduleWithCacheArgs) => {
const [startTime, endTime] = useTimesForSchedule({
month,
@@ -60,7 +60,7 @@ export const useSchedule = ({
duration: duration ? `${duration}` : undefined,
rescheduleUid,
orgSlug,
bookerEmail,
teamMemberEmail,
},
{
trpc: {