You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a form dialog that opens on top of another route like this:
/products - Route with products lists
/products/edit/10 - When you click edit on a product the form appears as an overlay dialog (the products list stays visible beneath)
On a successful form submission the form redirects to /products and a GET is sent to refetch the whole page.
On a failed form submission I get a funny request sequence
POST 10?_data=routes%2Fproducts%2F%24action.%24productId
GET 10?_data=routes%2Fproducts%2F%24action.%24productId
GET 10?_data=routes%2Fproducts
I tried returning 400 response from the action, but the GETs are called again.
unstable_shouldReload is also not helpful as it is not aware that there was a 400 error.
I would like to get rid of the two GET requests on error and only to have the POST request which doesn't refresh the page but returns the error data from the action handler that I can visualize.
The form is submitted with a submit button, not programatically.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a form dialog that opens on top of another route like this:
/products - Route with products lists
/products/edit/10 - When you click edit on a product the form appears as an overlay dialog (the products list stays visible beneath)
On a successful form submission the form redirects to /products and a GET is sent to refetch the whole page.
On a failed form submission I get a funny request sequence
I tried returning 400 response from the action, but the GETs are called again.
unstable_shouldReload
is also not helpful as it is not aware that there was a 400 error.I would like to get rid of the two GET requests on error and only to have the POST request which doesn't refresh the page but returns the error data from the action handler that I can visualize.
The form is submitted with a submit button, not programatically.
What I am missing? Thanks!
Beta Was this translation helpful? Give feedback.
All reactions