|
How do I configure the provider and resources to use /:comicId/chapters/:id ? <Refine
resources={[
{
name: 'chapters',
list: '/comics/:comicId/chapters', // http://localhost:3000/comics/123/chapters
show: '/comics/:comicId/chapters/:id', // http://localhost:3000/comics/123/chapters/1
create: '/comics/:comicId/chapters/create', // http://localhost:3000/comics/123/chapters/create
edit: '/comics/:comicId/chapters/:id/edit', // http://localhost:3000/comics/123/chapters/1/edit
clone: '/comics/:comicId/chapters/:id/clone' // http://localhost:3000/comics/123/chapters/1/clone
}
]}
/> |
Replies: 1 comment 3 replies
|
This is easily achievable with Refine. When in some other page that doesn't have Such as, if you're using <ListButton resource="chapters" meta={{ comicId: "123" }} />This will populate the If you want to have a default |

This is easily achievable with Refine. When in some other page that doesn't have
:comicIdparameter and you're about to redirect to thechaptersresource, you'll need to provide thecomicIdinmetaprop of the navigation method if you're using the ones that Refine provides.Such as, if you're using
<ListButton />:This will populate the
/:comicId/segment in the route and navigate to the requested list action of the "chapters" resource. Once it is present in the URL params, then Refine will infer the:comicIdfrom the URL and keep using it.If you want to have a default
:comicIddefined for your resource, you can use themetaof…