Disable redirect for cancellation page (#6498)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2023-01-16 09:20:50 +00:00
1 parent 76c087f29c
commit 3e27735ccb
2 files changed
+4 -3

No files matched your search

+3 -2
View File
@@ -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,
+1 -1
View File
@@ -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) =>