fix: payments on round-robin events (#11248)
* Fix condition when no users are found for event type * fix for typespull/11247/head^2
parent
86af383f6c
commit
75f9f045b8
|
@ -106,9 +106,11 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
|
||||||
|
|
||||||
if (!eventType) return { notFound: true };
|
if (!eventType) return { notFound: true };
|
||||||
|
|
||||||
const [user] = eventType.users;
|
if (eventType.users.length === 0 && !!!eventType.team) return { notFound: true };
|
||||||
if (!user) return { notFound: true };
|
|
||||||
|
|
||||||
|
const [user] = eventType?.users.length
|
||||||
|
? eventType.users
|
||||||
|
: [{ name: null, theme: null, hideBranding: null, username: null }];
|
||||||
const profile = {
|
const profile = {
|
||||||
name: eventType.team?.name || user?.name || null,
|
name: eventType.team?.name || user?.name || null,
|
||||||
theme: (!eventType.team?.name && user?.theme) || null,
|
theme: (!eventType.team?.name && user?.theme) || null,
|
||||||
|
|
Loading…
Reference in New Issue