How to modify the api path corresponding to the data #3908
Replies: 8 comments 5 replies
-
Hello @An0nymous0, you can use different data providers for different resources, see the documentation here: https://refine.dev/docs/api-reference/core/providers/data-provider/#multiple-data-providers Feel free to re-open it, if this doesn't answer your question. |
Beta Was this translation helpful? Give feedback.
-
@An0nymous0 First of all I would assume you are using Rest Api data provider package. If so, just take the core implementation from the github and modify it to your own needs, but this can be done to any data provider. Once you done just import that into App.tsx and pass that as props to your Refine wrapper instead of the generic ones offered by the team. And remember it's just JavaScript underthehood:) I had no problem modifying or creating custom stuff on top of the core library. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I have read the related material, but the method in the address is only applicable to the whole backend of the centralized package, generally there are multiple collaborators in the project, we assume that the quality of collaborators are not the same, the project api path There are subtle differences, how will I cope with this situation. For example: the user list interface provided by developer A is get /user, the user modification interface provided by developer B is
|
Beta Was this translation helpful? Give feedback.
-
@vinclou I wonder if there is such a way to deal with some situations outside the standard rules
The advantage of this is that if I encounter individual non-standard addresses I can temporarily override the standard by configuring |
Beta Was this translation helpful? Give feedback.
-
Suppose my user list interface address is https://api.fake-rest.refine.dev/userList, my project list interface address is https://api.fake-rest.refine.dev/project, and my category list interface address is https://api.fake-rest.refine.dev/categorys I don't know how to respond, multiple-data-providers shouldn't solve my doubts |
Beta Was this translation helpful? Give feedback.
-
@An0nymous0 I think you have conceptually misunderstood data provider, it makes the string URLs for you, you pass React page components to it to handle whatever happens on the route here's example of my set-up. It actually uses both many data providers and |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@vinclou Thanks I seem to understand, thank you for your reply |
Beta Was this translation helpful? Give feedback.
-
Because some backends may be non-standardized restful api How to customize the interface address corresponding to the page 。
Beta Was this translation helpful? Give feedback.
All reactions