Scheduling infrastructure for absolutely everyone.
fix: Single Use Private link does not regenerate after use (#11705)
Aldrin1298b05e1a05
diff --git a/apps/web/pages/d/[link]/[slug].tsx b/apps/web/pages/d/[link]/[slug].tsxindex f70f0b6a344..73b4e91f02f 100644--- a/apps/web/pages/d/[link]/[slug].tsx+++ b/apps/web/pages/d/[link]/[slug].tsx@@ -27,6 +27,7 @@ export default function Type({isTeamEvent,entity,duration,+ hashedLink,}: PageProps) {return (<main className={getBookerWrapperClasses({ isEmbed: !!isEmbed })}>@@ -46,6 +47,7 @@ export default function Type({isTeamEvent={isTeamEvent}entity={entity}duration={duration}+ hashedLink={hashedLink}/></main>);@@ -149,6 +151,7 @@ async function getUserPageProps(context: GetServerSidePropsContext) {// Sending the team event from the server, because this template file// is reused for both team and user events.isTeamEvent,+ hashedLink: link,},};}diff --git a/packages/features/bookings/Booker/Booker.tsx b/packages/features/bookings/Booker/Booker.tsxindex d8995856ff8..622da4cf774 100644--- a/packages/features/bookings/Booker/Booker.tsx+++ b/packages/features/bookings/Booker/Booker.tsx@@ -44,6 +44,7 @@ const BookerComponent = ({isTeamEvent,entity,duration,+ hashedLink,}: BookerProps) => {/*** Prioritize dateSchedule load@@ -285,6 +286,7 @@ const BookerComponent = ({setSeatedEventData({ ...seatedEventData, bookingUid: undefined, attendees: undefined });}}}+ hashedLink={hashedLink}/></BookerSection>diff --git a/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx b/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsxindex 7c12ff94781..60f9a627cf4 100644--- a/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx+++ b/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx@@ -41,11 +41,12 @@ import { FormSkeleton } from "./Skeleton";type BookEventFormProps = {onCancel?: () => void;+ hashedLink?: string | null;};type DefaultValues = Record<string, unknown>;-export const BookEventForm = ({ onCancel }: BookEventFormProps) => {+export const BookEventForm = ({ onCancel, hashedLink }: BookEventFormProps) => {const [slotReservationId, setSlotReservationId] = useSlotReservationId();const reserveSlotMutation = trpc.viewer.public.slots.reserveSlot.useMutation({trpc: {@@ -114,6 +115,7 @@ export const BookEventForm = ({ onCancel }: BookEventFormProps) => {isRescheduling={isRescheduling}eventQuery={eventQuery}rescheduleUid={rescheduleUid}+ hashedLink={hashedLink}/>);};@@ -124,11 +126,13 @@ export const BookEventFormChild = ({isRescheduling,eventQuery,rescheduleUid,+ hashedLink,}: BookEventFormProps & {initialValues: DefaultValues;isRescheduling: boolean;eventQuery: ReturnType<typeof useEvent>;rescheduleUid: string | null;+ hashedLink?: string | null;}) => {const eventType = eventQuery.data;const bookingFormSchema = z@@ -332,6 +336,7 @@ export const BookEventFormChild = ({}),{}),+ hashedLink,};if (eventQuery.data?.recurringEvent?.freq && recurringEventCount) {diff --git a/packages/features/bookings/Booker/types.ts b/packages/features/bookings/Booker/types.tsindex dbbf9ec5c47..badfe667c8e 100644--- a/packages/features/bookings/Booker/types.ts+++ b/packages/features/bookings/Booker/types.ts@@ -64,6 +64,10 @@ export interface BookerProps {* otherwise, the default value is selected*/duration?: number | null;+ /**+ * Refers to the private link from event types page.+ */+ hashedLink?: string | null;}export type BookerState = "loading" | "selecting_date" | "selecting_time" | "booking";diff --git a/packages/features/bookings/lib/book-event-form/booking-to-mutation-input-mapper.tsx b/packages/features/bookings/lib/book-event-form/booking-to-mutation-input-mapper.tsxindex f9ca1cf538f..2abed190987 100644--- a/packages/features/bookings/lib/book-event-form/booking-to-mutation-input-mapper.tsx+++ b/packages/features/bookings/lib/book-event-form/booking-to-mutation-input-mapper.tsx@@ -18,6 +18,7 @@ type BookingOptions = {metadata?: Record<string, string>;bookingUid?: string;seatReferenceUid?: string;+ hashedLink?: string | null;};export const mapBookingToMutationInput = ({@@ -32,6 +33,7 @@ export const mapBookingToMutationInput = ({metadata,bookingUid,seatReferenceUid,+ hashedLink,}: BookingOptions): BookingCreateBody => {return {...values,@@ -47,11 +49,10 @@ export const mapBookingToMutationInput = ({language: language,rescheduleUid,metadata: metadata || {},- hasHashedBookingLink: false,+ hasHashedBookingLink: hashedLink ? true : false,bookingUid,seatReferenceUid,- // hasHashedBookingLink,- // hashedLink,+ hashedLink,};};