I have a reducer that contains a function that creates a POST fetch request, and am able to use this function just fine on certain pages, but on a page where useParams is being used, it will change the api of the fetch, resulting in a 404 error:
the correct fetch should be : fetch("api/update-cart", ...)
i have a button on a test page which runs this function when clicks. the route for the page does not use useParams (route /test) - and it all works fine
but on a page which does use useParams (route /details/:productId), the fetch in my reducer seems to be using the useParams and fetching from /details/api/update-cart rather than just "api/update-cart", so I get a a 404.
Response {type: 'basic', url: 'http://localhost:3000/details/api/update-cart', redirected: false, status: 404, ok: false, …}
any ideas how to get it to not dynamically render the fetch url?