Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redirect to new form after successful submission #87

Closed
stefpiatek opened this issue Nov 9, 2022 · 2 comments · Fixed by #90
Closed

redirect to new form after successful submission #87

stefpiatek opened this issue Nov 9, 2022 · 2 comments · Fixed by #90
Assignees

Comments

@stefpiatek
Copy link
Collaborator

stefpiatek commented Nov 9, 2022

Upon success of the report form submission, and no errors found. We should redirect to the NewReport page.

At a quick look we'll need to

  • useNavigate (from react router should work for us here I'd expect) if there are no errors in the ReportForm submit .then block
  • update the ReportForm test to check that this has been redirected to a fresh page (so we should be able to see the patient fields), probably can also then remove the redirect test from ReportForm.test.ts
  • Remove the result section in ReportForm, the setResult and their usages
  • Probably worth for now keeping on logging the bundle, as that could still be useful.
@stefpiatek
Copy link
Collaborator Author

Also intruiged for you to test in the front end what happens if we set the error modal during an error, and then redirect at the end of the .then block. I imagine that it won't render the modal? But if it does then that would be even more fun.

@acholyn
Copy link
Collaborator

acholyn commented Nov 11, 2022

modal is rendered and isn't redirected 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants