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

* Fix condition when no users are found for event type

* fix for types
pull/11247/head^2
alannnc 2023-09-12 08:59:32 -07:00 committed by GitHub
parent 86af383f6c
commit 75f9f045b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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,