fix: payments on round-robin events (#11248)

* Fix condition when no users are found for event type

* fix for types
This commit is contained in:
alannnc
2023-09-12 08:59:32 -07:00
committed by GitHub
parent 86af383f6c
commit 75f9f045b8
@@ -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,