sacred-roseS
Refine14mo ago
4 replies
sacred-rose

getToPath does not give correct url

I use
getToPath({
          resource: select("myresource").resource,
          action: "show",
          meta: {
            id: myId,
          },
        })


with a route

  <Route path="/exports">
                    <Route index element={<MyResourceList></MyResourceList>} />
                    <Route path="show/:id" element={<MyResourceShow/>} />
                    <Route path="create" element={<CreateResource/>} />
                  </Route>


it will return /myresource/myId
not /myresourrce/show/myId
as I thought it would

Also example of "useGetToPath" online is broken, the resource parameter is not a string but an IResourceItem
Was this page helpful?