Skip to content

Scheduling infrastructure for absolutely everyone.

Fix rescheduling error with attendee phone number as location (#5657)

Carina Wollendorfer38d8852819df
diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx
index 472ddb24202..49744232aa3 100644
--- a/apps/web/components/booking/pages/BookingPage.tsx
+++ b/apps/web/components/booking/pages/BookingPage.tsx
@@ -622,7 +622,7 @@ const BookingPage = ({
)}
</>
{/* TODO: Change name and id ="phone" to something generic */}
- {AttendeeInput && (
+ {AttendeeInput && !disableInput && (
<div className="mb-4">
<label
htmlFor={
@@ -659,7 +659,6 @@ const BookingPage = ({
: ""
}
required
- disabled={disableInput}
/>
</div>
{bookingForm.formState.errors.phone && (
diff --git a/apps/web/pages/success.tsx b/apps/web/pages/success.tsx
index c97a971673c..60851977d14 100644
--- a/apps/web/pages/success.tsx
+++ b/apps/web/pages/success.tsx
@@ -1,4 +1,4 @@
-import { BookingStatus } from "@prisma/client";
+import { BookingStatus, WorkflowActions } from "@prisma/client";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
import classNames from "classnames";
import { createEvent } from "ics";
@@ -298,6 +298,11 @@ export default function Success(props: SuccessProps) {
const locationToDisplay = getSuccessPageLocationMessage(location, t);
+ const hasSMSAttendeeAction =
+ eventType.workflows.find((workflowEventType) =>
+ workflowEventType.workflow.steps.find((step) => step.action === WorkflowActions.SMS_ATTENDEE)
+ ) !== undefined;
+
return (
<div className={isEmbed ? "" : "h-screen"} data-testid="success-page">
{userIsOwner && !isEmbed && (
@@ -452,7 +457,7 @@ export default function Success(props: SuccessProps) {
</>
);
})}
- {bookingInfo?.smsReminderNumber && (
+ {bookingInfo?.smsReminderNumber && hasSMSAttendeeAction && (
<>
<div className="mt-9 font-medium">{t("number_sms_notifications")}</div>
<div className="col-span-2 mb-2 mt-9">
@@ -777,6 +782,15 @@ const getEventTypesFromDB = async (id: number) => {
hideBranding: true,
},
},
+ workflows: {
+ select: {
+ workflow: {
+ select: {
+ steps: true,
+ },
+ },
+ },
+ },
metadata: true,
seatsPerTimeSlot: true,
seatsShowAttendees: true,
diff --git a/packages/prisma/zod-utils.ts b/packages/prisma/zod-utils.ts
index c999fa2efbb..716cf3a6938 100644
--- a/packages/prisma/zod-utils.ts
+++ b/packages/prisma/zod-utils.ts
@@ -153,7 +153,7 @@ export const extendedBookingCreateBody = bookingCreateBodySchema.merge(
allRecurringDates: z.string().array().optional(),
currentRecurringIndex: z.number().optional(),
rescheduleReason: z.string().optional(),
- smsReminderNumber: z.string().optional(),
+ smsReminderNumber: z.string().optional().nullable(),
appsStatus: z
.array(
z.object({