diff --git a/ee/pages/payment/[uid].tsx b/ee/pages/payment/[uid].tsx index 0b794ab703..df2932469c 100644 --- a/ee/pages/payment/[uid].tsx +++ b/ee/pages/payment/[uid].tsx @@ -65,11 +65,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => }, }); - if (!rawPayment) { - return { - notFound: true, - }; - } + if (!rawPayment) throw Error("Payment not found"); const { data, booking: _booking, ...restPayment } = rawPayment; const payment = { @@ -77,7 +73,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => data: data as unknown as PaymentData, }; - if (!_booking) return { notFound: true }; + if (!_booking) throw Error("Booking not found"); const { startTime, eventType, ...restBooking } = _booking; const booking = { @@ -85,7 +81,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => startTime: startTime.toString(), }; - if (!eventType) return { notFound: true }; + if (!eventType) throw Error("Event not found"); const [user] = eventType.users; if (!user) return { notFound: true };