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'm using router.post() to send FormData (from '/' endpoint) to a POST endpoint Controller which does not have GET method, only POST. So when I use router.post(/post-only-endpoint), after sending the form, the browser URL changes to that URL (which I don't want to) and then if I have to send again the form and lets say that the $request->validate() aborts, then a pop up shows saying that I cannot do a GET request to that endpoint: (because now I'm sending the request from /post-only-endpoint)
I know I can use axios or fetch but I want the integration that offers Inertia to update the component properties and error settings on every router.visit action
So I propose to add a variable in router.visit() method, called followUrl (by default to true) which if you set it to false, on setPage method
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
-
Hello there!
I'm using router.post() to send FormData (from '/' endpoint) to a POST endpoint Controller which does not have GET method, only POST. So when I use router.post(/post-only-endpoint), after sending the form, the browser URL changes to that URL (which I don't want to) and then if I have to send again the form and lets say that the $request->validate() aborts, then a pop up shows saying that I cannot do a GET request to that endpoint: (because now I'm sending the request from /post-only-endpoint)
I know I can use axios or fetch but I want the integration that offers Inertia to update the component properties and error settings on every router.visit action
So I propose to add a variable in router.visit() method, called followUrl (by default to true) which if you set it to false, on setPage method
inertia/packages/core/src/router.ts
Line 457 in ca7e7cb
allows to call replaceState/pushState like this:
And thus, keep the url browser untouched.
Sorry for my bad english.I hope the message is understood.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions