Skip to content

Commit 32a89c3

Browse files
fix: [object object] for name when rescheduling a past booking (calcom#21695)
1 parent 5404eee commit 32a89c3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/web/lib/reschedule/[uid]/getServerSideProps.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { URLSearchParams } from "url";
44
import { z } from "zod";
55

66
import { getServerSession } from "@calcom/features/auth/lib/getServerSession";
7+
import { getFullName } from "@calcom/features/form-builder/utils";
78
import { buildEventUrlFromBooking } from "@calcom/lib/bookings/buildEventUrlFromBooking";
89
import { getDefaultEvent } from "@calcom/lib/defaultEvents";
910
import { getSafe } from "@calcom/lib/getSafe";
@@ -139,7 +140,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
139140
if (isBookingInPast && !eventType.allowReschedulingPastBookings) {
140141
const destinationUrlSearchParams = new URLSearchParams();
141142
const responses = bookingSeat ? getSafe<string>(bookingSeat.data, ["responses"]) : booking.responses;
142-
const name = getSafe<string>(responses, ["name"]);
143+
const name = getFullName(getSafe<string | { firstName: string; lastName?: string }>(responses, ["name"]));
143144
const email = getSafe<string>(responses, ["email"]);
144145

145146
if (name) destinationUrlSearchParams.set("name", name);

0 commit comments

Comments
 (0)