-
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
}
]}
/> |
Beta Was this translation helpful? Give feedback.
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 |
Beta Was this translation helpful? Give feedback.
This is easily achievable with Refine. When in some other page that doesn't have
:comicId
parameter and you're about to redirect to thechapters
resource, you'll need to provide thecomicId
inmeta
prop 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:comicId
from the URL and keep using it.If you want to have a default
:comicId
defined for your resource, you can use themeta
of…