From 716407ad900913a82bb577cfe7c6d6c98aefa820 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Mon, 16 Jan 2023 10:46:06 +0000 Subject: [PATCH] Added fallback to hostsFixed too which is used in COLLECTIVE (#6500) --- apps/web/pages/event-types/[type]/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/event-types/[type]/index.tsx b/apps/web/pages/event-types/[type]/index.tsx index 796a253f7f..48756f9124 100644 --- a/apps/web/pages/event-types/[type]/index.tsx +++ b/apps/web/pages/event-types/[type]/index.tsx @@ -204,8 +204,14 @@ const EventTypePage = (props: EventTypeSetupProps) => { metadata, hosts: !!eventType.hosts?.length ? eventType.hosts.filter((host) => !host.isFixed) - : eventType.users.map((user) => ({ userId: user.id })), - hostsFixed: eventType.hosts.filter((host) => host.isFixed), + : eventType.users + .filter(() => eventType.schedulingType === SchedulingType.ROUND_ROBIN) + .map((user) => ({ userId: user.id })), + hostsFixed: !!eventType.hosts?.length + ? eventType.hosts.filter((host) => host.isFixed) + : eventType.users + .filter(() => eventType.schedulingType === SchedulingType.COLLECTIVE) + .map((user) => ({ userId: user.id })), }, resolver: zodResolver( z