From 75f9f045b8c2633b8bb31f75cf0705abe947c816 Mon Sep 17 00:00:00 2001 From: alannnc Date: Tue, 12 Sep 2023 08:59:32 -0700 Subject: [PATCH] fix: payments on round-robin events (#11248) * Fix condition when no users are found for event type * fix for types --- packages/features/ee/payments/pages/payment.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/features/ee/payments/pages/payment.tsx b/packages/features/ee/payments/pages/payment.tsx index f9dc8a0dbc..02d4ba75cc 100644 --- a/packages/features/ee/payments/pages/payment.tsx +++ b/packages/features/ee/payments/pages/payment.tsx @@ -106,9 +106,11 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => if (!eventType) return { notFound: true }; - const [user] = eventType.users; - if (!user) return { notFound: true }; + if (eventType.users.length === 0 && !!!eventType.team) return { notFound: true }; + const [user] = eventType?.users.length + ? eventType.users + : [{ name: null, theme: null, hideBranding: null, username: null }]; const profile = { name: eventType.team?.name || user?.name || null, theme: (!eventType.team?.name && user?.theme) || null,