Scheduling infrastructure for absolutely everyone.
Disable redirect for cancellation page (#6498)
Hariom Balhara3e27735ccb5f
diff --git a/apps/web/pages/booking/[uid].tsx b/apps/web/pages/booking/[uid].tsxindex 134ff070cf3..b11184ea823 100644--- a/apps/web/pages/booking/[uid].tsx+++ b/apps/web/pages/booking/[uid].tsx@@ -929,6 +929,7 @@ const schema = z.object({uid: z.string(),email: z.string().optional(),eventTypeSlug: z.string().optional(),+ cancel: stringToBoolean,});const handleSeatsEventTypeOnBooking = (@@ -962,7 +963,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {const ssr = await ssrInit(context);const parsedQuery = schema.safeParse(context.query);if (!parsedQuery.success) return { notFound: true };- const { uid, email, eventTypeSlug } = parsedQuery.data;+ const { uid, email, eventTypeSlug, cancel } = parsedQuery.data;const bookingInfo = await prisma.booking.findFirst({where: {@@ -1048,7 +1049,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {customInputs: customInputSchema.array().parse(eventTypeRaw.customInputs),};- if (eventType.metadata?.disableSuccessPage && eventType.successRedirectUrl) {+ if (eventType.metadata?.disableSuccessPage && eventType.successRedirectUrl && !cancel) {return {redirect: {destination: eventType.successRedirectUrl,diff --git a/packages/emails/templates/_base-email.ts b/packages/emails/templates/_base-email.tsindex 78f72a6f9b8..907049df3b8 100644--- a/packages/emails/templates/_base-email.ts+++ b/packages/emails/templates/_base-email.ts@@ -30,7 +30,7 @@ export default class BaseEmail {if (process.env.NEXT_PUBLIC_IS_E2E) {global.E2E_EMAILS = global.E2E_EMAILS || [];global.E2E_EMAILS.push(this.getNodeMailerPayload());- console.log("Skipped Sending Email");+ console.log("Skipped Sending Email as NEXT_PUBLIC_IS_E2E==1");return new Promise((r) => r("Skipped sendEmail for E2E"));}new Promise((resolve, reject) =>