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

BNGP-5498: Credits: Follow post-redirect-get pattern #897

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

thousand-leaves
Copy link
Collaborator

@thousand-leaves thousand-leaves commented Oct 10, 2024

https://eaflood.atlassian.net/browse/BNGP-5498

This change implements the post-redirect-get pattern as best practice in order to avoid unwanted behaviours such as form re-submission and display of incorrect error message and data.

  • packages/webapp/src/plugins/redirect-view.js -> a plugin to redirect to the error view (post-redirect-get pattern)
  • packages/webapp/src/utils/redirect-view-handler.js -> a helper to add a boolean used by the above plugin (indicating that we want to return h.view following such a redirect).

Other changes are mostly where we implement the usage of the plugin when returning a view to display an error message following a form POST.

https://eaflood.atlassian.net/browse/BNGP-5498

This change implements the post-redirect-get pattern as best practice in order to avoid unwanted behaviours such as form re-submission and display of incorrect error message and data.
@thousand-leaves thousand-leaves self-assigned this Oct 10, 2024
Copy link

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 this pull request may close these issues.

1 participant