Skip to content

Commit

Permalink
Add check to avoid new group registrations to navigate to holding page (
Browse files Browse the repository at this point in the history
  • Loading branch information
camilovegag authored May 8, 2024
1 parent 239db86 commit ccad72a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/berlin/src/pages/Register.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ function Register() {
mode={form.mode}
event={event}
groupId={groupId}
groupCategoryParam={groupCategoryParam}
/>
);
})}
Expand Down Expand Up @@ -252,6 +253,7 @@ function RegisterForm(props: {
groupId?: string;
show: boolean;
mode: 'edit' | 'create';
groupCategoryParam: string | null;
}) {
const navigate = useNavigate();
const queryClient = useQueryClient();
Expand Down Expand Up @@ -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');
}
Expand All @@ -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');
}
Expand Down

0 comments on commit ccad72a

Please sign in to comment.