Skip to content

How do I configure the provider and resources to use /:comicId/chapters/:id ? #6175

Closed Answered by aliemir
DoCongSon asked this question in Q&A
Discussion options

You must be logged in to vote

This is easily achievable with Refine. When in some other page that doesn't have :comicId parameter and you're about to redirect to the chapters resource, you'll need to provide the comicId in meta prop of the navigation method if you're using the ones that Refine provides.

Such as, if you're using <ListButton />:

<ListButton resource="chapters" meta={{ comicId: "123" }} />

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 the meta of…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@DoCongSon
Comment options

@aliemir
Comment options

@DoCongSon
Comment options

Answer selected by aliemir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants