Add /embed route for booking/[uid] (#11976)

Co-authored-by: Syed Ali Shahbaz <52925846+alishaz-polymath@users.noreply.github.com>
pull/11987/head
Hariom Balhara 2023-10-19 00:13:12 +05:30 committed by GitHub
parent 8c0751b186
commit 629629cb9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -1042,7 +1042,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
const parsedQuery = querySchema.safeParse(context.query); const parsedQuery = querySchema.safeParse(context.query);
if (!parsedQuery.success) return { notFound: true }; if (!parsedQuery.success) return { notFound: true } as const;
const { uid, eventTypeSlug, seatReferenceUid } = parsedQuery.data; const { uid, eventTypeSlug, seatReferenceUid } = parsedQuery.data;
const { uid: maybeUid } = await maybeGetBookingUidFromSeat(prisma, uid); const { uid: maybeUid } = await maybeGetBookingUidFromSeat(prisma, uid);
@ -1100,7 +1100,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!bookingInfoRaw) { if (!bookingInfoRaw) {
return { return {
notFound: true, notFound: true,
}; } as const;
} }
const eventTypeRaw = !bookingInfoRaw.eventTypeId const eventTypeRaw = !bookingInfoRaw.eventTypeId
@ -1109,7 +1109,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!eventTypeRaw) { if (!eventTypeRaw) {
return { return {
notFound: true, notFound: true,
}; } as const;
} }
if (eventTypeRaw.seatsPerTimeSlot && !seatReferenceUid && !session) { if (eventTypeRaw.seatsPerTimeSlot && !seatReferenceUid && !session) {
@ -1130,7 +1130,7 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
if (!eventTypeRaw.owner) if (!eventTypeRaw.owner)
return { return {
notFound: true, notFound: true,
}; } as const;
eventTypeRaw.users.push({ eventTypeRaw.users.push({
...eventTypeRaw.owner, ...eventTypeRaw.owner,
}); });

View File

@ -0,0 +1,7 @@
import withEmbedSsr from "@lib/withEmbedSsr";
import { getServerSideProps as _getServerSideProps } from "../[uid]";
export { default } from "../[uid]";
export const getServerSideProps = withEmbedSsr(_getServerSideProps);