-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create an url like /articles/:articleId/comments
?
#2
Comments
An example here: https://stackblitz.com/edit/rest-hooks?embed=1&file=resources/CommentResource.ts&hideExplorer=1&view=editor or a more complex case here https://stackblitz.com/edit/rest-hooks?embed=1&file=resources/IssueResource.tsx&view=editor Basically you can use some of the members of searchParams to build the base url, and if you still want a querystring use the remaining to build that part of the url. |
Thank you :) |
Hello,
I'm struggling to understand the url builder.
It seems we can override the url when using singleRequest()
https://github.com/coinbase/rest-hooks/blob/master/src/resource/Resource.ts#L150
https://github.com/coinbase/rest-hooks/blob/master/src/resource/Resource.ts#L93-L99
But for listRequest, it's really limited:
https://github.com/coinbase/rest-hooks/blob/master/src/resource/Resource.ts#L167
https://github.com/coinbase/rest-hooks/blob/master/src/resource/Resource.ts#L111
Can you add a doc on how to build the url ?
Does a static method to build an url from params in the resource makes sense to you ?
Thank you,
The text was updated successfully, but these errors were encountered: