fix: rescheduledBy to carry into success url redirect (#16931)
This commit is contained in:
@@ -161,7 +161,11 @@ export default function Success(props: PageProps) {
|
||||
const [calculatedDuration, setCalculatedDuration] = useState<number | undefined>(undefined);
|
||||
const [comment, setComment] = useState("");
|
||||
const parsedRating = rating ? parseInt(rating, 10) : 3;
|
||||
const currentUserEmail = searchParams?.get("cancelledBy") ?? session?.user?.email ?? undefined;
|
||||
const currentUserEmail =
|
||||
searchParams?.get("rescheduledBy") ??
|
||||
searchParams?.get("cancelledBy") ??
|
||||
session?.user?.email ??
|
||||
undefined;
|
||||
|
||||
const defaultRating = isNaN(parsedRating) ? 3 : parsedRating > 5 ? 5 : parsedRating < 1 ? 1 : parsedRating;
|
||||
const [rateValue, setRateValue] = useState<number>(defaultRating);
|
||||
|
||||
@@ -108,6 +108,7 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, teamMemb
|
||||
const isInstantMeeting = useBookerStore((state) => state.isInstantMeeting);
|
||||
|
||||
const rescheduleUid = useBookerStore((state) => state.rescheduleUid);
|
||||
const rescheduledBy = useBookerStore((state) => state.rescheduledBy);
|
||||
const bookingData = useBookerStore((state) => state.bookingData);
|
||||
const timeslot = useBookerStore((state) => state.selectedTimeslot);
|
||||
const { t } = useLocale();
|
||||
@@ -260,6 +261,7 @@ export const useBookings = ({ event, hashedLink, bookingForm, metadata, teamMemb
|
||||
seatReferenceUid: "seatReferenceUid" in booking ? booking.seatReferenceUid : null,
|
||||
formerTime:
|
||||
isRescheduling && bookingData?.startTime ? dayjs(bookingData.startTime).toString() : undefined,
|
||||
rescheduledBy, // ensure further reschedules performed on the success page are recorded correctly
|
||||
};
|
||||
|
||||
bookingSuccessRedirect({
|
||||
|
||||
Reference in New Issue
Block a user