Prevents a 404 page for payments (#770)
parent
63930c1817
commit
50367c236a
|
@ -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 };
|
||||
|
|
Loading…
Reference in New Issue