I'm trying to make a redirect using router.push
to pass a query string, but when I try to pass a value in my param with special characters as a comma is encoding my URL. Is it possible to pass ',' into an URL using router.push
?
I have tried a lot of things but I don't know how to make it work.
router.push({
pathname: router.pathname,
query: { ...router.query, pets: 'cats,dogs'},
})
The resulting URL will be myurl?pets=cats%2Cdogs
, I want it to be myurl?pets=cats,dogs
.