Skip to content

Commit eef405e

Browse files
If booking doesnt exist its 404 page but if it exists and eventType doesnt exist, log it for now and continue with the flow (#3202)
1 parent 1469b85 commit eef405e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

apps/web/pages/reschedule/[uid].tsx

+13-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,19 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
3838
},
3939
});
4040
const dynamicEventSlugRef = booking?.dynamicEventSlugRef || "";
41-
if (!booking?.eventType && !booking?.dynamicEventSlugRef) throw Error("This booking doesn't exists");
41+
42+
if (!booking) {
43+
return {
44+
notFound: true,
45+
};
46+
}
47+
48+
if (!booking?.eventType && !booking?.dynamicEventSlugRef) {
49+
// TODO: Show something in UI to let user know that this booking is not rescheduleable.
50+
return {
51+
notFound: true,
52+
};
53+
}
4254

4355
const eventType = booking.eventType ? booking.eventType : getDefaultEvent(dynamicEventSlugRef);
4456

0 commit comments

Comments
 (0)