From db7439121d10810f2c579d34e5f552116a4a1785 Mon Sep 17 00:00:00 2001 From: camilovegag Date: Wed, 8 May 2024 09:35:11 -0500 Subject: [PATCH] Add check to avoid new group registrations to navigate to holding page --- packages/berlin/src/pages/Register.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/berlin/src/pages/Register.tsx b/packages/berlin/src/pages/Register.tsx index d735c338..d4e9dbdf 100644 --- a/packages/berlin/src/pages/Register.tsx +++ b/packages/berlin/src/pages/Register.tsx @@ -209,6 +209,7 @@ function Register() { mode={form.mode} event={event} groupId={groupId} + groupCategoryParam={groupCategoryParam} /> ); })} @@ -252,6 +253,7 @@ function RegisterForm(props: { groupId?: string; show: boolean; mode: 'edit' | 'create'; + groupCategoryParam: string | null; }) { const navigate = useNavigate(); const queryClient = useQueryClient(); @@ -301,7 +303,11 @@ function RegisterForm(props: { await queryClient.invalidateQueries({ queryKey: ['registration', 'data'], }); - navigate(`/events/${props.event?.id}/holding`); + if (props.groupCategoryParam) { + return; + } else { + navigate(`/events/${props.event?.id}/holding`); + } } else { toast.error('Failed to save registration, please try again'); } @@ -323,7 +329,11 @@ function RegisterForm(props: { await queryClient.invalidateQueries({ queryKey: [props.registrationId, 'registration', 'data'], }); - navigate(`/events/${props.event?.id}/holding`); + if (props.groupCategoryParam) { + return; + } else { + navigate(`/events/${props.event?.id}/holding`); + } } else { toast.error('Failed to update registration, please try again'); }