#Preserve query params after router.put(...)

1 messages · Page 1 of 1 (latest)

quasi roost
#

I have a app that contains some state saved in query params. In this app I have form and I do a router.put(...) to a endpoint that updates an entry and afterwards to_route to the index endpoint. In this process I lost the query params that I had before the router.put (probably because they are not sent in a router.put?) that I still need after the redirect.

Is there any way to preserve them?
Using onFinish in the router.put with a router.reload({data: {...}) creates a lot of flickering in the url and in the ui, since it changes from not having some state to having some state.

Thanks in advance!

#

Preserve query params after router.put(...)

sacred wedge
#

@quasi roost Are you on the index endpoint when you do the router put or are you on maybe an edit page where you make the put request and you’re redirecting to the index page?

quasi roost
#

@sacred wedge I am on the index endpoint, call router put on it and I redirect to_route(“index”)