diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index 472ddb2420..49744232aa 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 && (
{bookingForm.formState.errors.phone && ( diff --git a/apps/web/pages/success.tsx b/apps/web/pages/success.tsx index c97a971673..60851977d1 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 (
{userIsOwner && !isEmbed && ( @@ -452,7 +457,7 @@ export default function Success(props: SuccessProps) { ); })} - {bookingInfo?.smsReminderNumber && ( + {bookingInfo?.smsReminderNumber && hasSMSAttendeeAction && ( <>
{t("number_sms_notifications")}
@@ -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 c999fa2efb..716cf3a693 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({