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

@@ -21,7 +21,6 @@ import { useBookerStore, useInitializeBookerStore } from "@calcom/features/booki
import { useEvent, useScheduleForEvent } from "@calcom/features/bookings/Booker/utils/event";
import { useBrandColors } from "@calcom/features/bookings/Booker/utils/use-brand-colors";
import { DEFAULT_LIGHT_BRAND_COLOR, DEFAULT_DARK_BRAND_COLOR } from "@calcom/lib/constants";
import { useDebounce } from "@calcom/lib/hooks/useDebounce";
import { useRouterQuery } from "@calcom/lib/hooks/useRouterQuery";
import { BookerLayouts } from "@calcom/prisma/zod-utils";
@@ -122,7 +121,6 @@ export const BookerWebWrapper = (props: BookerWebWrapperAtomProps) => {
* Prioritize dateSchedule load
* Component will render but use data already fetched from here, and no duplicate requests will be made
* */
const debouncedFormEmail = useDebounce(bookerForm.formEmail, 600);
const schedule = useScheduleForEvent({
prefetchNextMonth,
username: props.username,
@@ -132,14 +130,14 @@ export const BookerWebWrapper = (props: BookerWebWrapperAtomProps) => {
month: props.month,
duration: props.duration,
selectedDate,
bookerEmail: debouncedFormEmail,
teamMemberEmail: props.teamMemberEmail,
});
const bookings = useBookings({
event,
hashedLink: props.hashedLink,
bookingForm: bookerForm.bookingForm,
metadata: metadata ?? {},
teamMemberEmail: schedule.data?.teamMember,
teamMemberEmail: props.teamMemberEmail,
});
const verifyCode = useVerifyCode({
@@ -21,7 +21,6 @@ type UseHandleBookingProps = {
};
metadata: Record<string, string>;
hashedLink?: string | null;
teamMemberEmail?: string;
handleBooking: (input: UseCreateBookingInput) => void;
handleInstantBooking: (input: BookingCreateBody) => void;
handleRecBooking: (input: BookingCreateBody[]) => void;
@@ -33,7 +32,6 @@ export const useHandleBookEvent = ({
event,
metadata,
hashedLink,
teamMemberEmail,
handleBooking,
handleInstantBooking,
handleRecBooking,
@@ -52,6 +50,7 @@ export const useHandleBookEvent = ({
const seatedEventData = useBookerStore((state) => state.seatedEventData);
const isInstantMeeting = useBookerStore((state) => state.isInstantMeeting);
const orgSlug = useBookerStore((state) => state.org);
const teamMemberEmail = useBookerStore((state) => state.teamMemberEmail);
const handleBookEvent = () => {
const values = bookingForm.getValues();