fix: instant booking location lookup (#27517)

Use booking uid instead of numeric id for instant booking location
  endpoint, aligning with existing booking endpoint patterns
This commit is contained in:
Pedro Castro authored and GitHub committed 2026-02-02 14:19:52 -03:00
1 parent c43c48b1a8
commit 1ff307bb44
3 files changed
+13 -13

No files matched your search

@@ -158,13 +158,13 @@ const setInstantCooldownNow = (eventTypeId?: number | null) => {
const storeInLocalStorage = ({
eventTypeId,
expiryTime,
bookingId,
bookingUid,
}: {
eventTypeId: number;
expiryTime: Date;
bookingId: number;
bookingUid: string;
}) => {
const value = JSON.stringify({ eventTypeId, expiryTime, bookingId });
const value = JSON.stringify({ eventTypeId, expiryTime, bookingUid });
localStorage.setItem(STORAGE_KEY, value);
};
@@ -194,7 +194,7 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, isBookin
const isRescheduling = !!rescheduleUid && !!bookingData;
const bookingId = parseInt(getQueryParam("bookingId") ?? "0");
const bookingUid = getQueryParam("bookingUid") ?? "";
useEffect(() => {
if (!isInstantMeeting) return;
@@ -213,7 +213,7 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, isBookin
if (parsedInstantBookingInfo) {
setExpiryTime(parsedInstantBookingInfo.expiryTime);
updateQueryParam("bookingId", parsedInstantBookingInfo.bookingId);
updateQueryParam("bookingUid", parsedInstantBookingInfo.bookingUid);
}
}
}, [eventTypeId, isInstantMeeting]);
@@ -222,10 +222,10 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, isBookin
const _instantBooking = trpc.viewer.bookings.getInstantBookingLocation.useQuery(
{
bookingId: bookingId,
bookingUid: bookingUid,
},
{
enabled: !!bookingId,
enabled: !!bookingUid,
refetchInterval: 2000,
refetchIntervalInBackground: true,
}
@@ -421,12 +421,12 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, isBookin
storeInLocalStorage({
eventTypeId,
expiryTime: responseData.expires,
bookingId: responseData.bookingId,
bookingUid: responseData.bookingUid,
});
setInstantCooldownNow(eventTypeId);
}
updateQueryParam("bookingId", responseData.bookingId);
updateQueryParam("bookingUid", responseData.bookingUid);
setExpiryTime(responseData.expires);
},
onError: (err) => {