custom endpoint for create page
3 Replies
Hi @Pipo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the information provided in the extracts, it's not directly possible to set a custom endpoint for a specific component like
Create
. The Create
component in Refine uses the resource
prop to determine which endpoint to interact with. This resource
prop is usually defined in the resources
array in the Refine
component in your App.tsx
file.
However, you can customize the endpoints your application interacts with by customizing your data provider. The data provider is responsible for making the actual HTTP requests to your API. By customizing the data provider, you can control the endpoints that are used for different operations like create
, update
, delete
, etc.
Unfortunately, the extracts provided do not contain specific information on how to customize the data provider in Refine. For more detailed instructions, you should refer to the Refine documentation on data providers (https://refine.dev/docs/data-provider/introduction).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@700383601887543303> kapa.ai is still learning and improving, please let us know how it did by reacting below
fascinating-indigo•8mo ago
but when i change in app.jsx
<Refine
dataProvider={dataProvider(HOST_URL)}
notificationProvider={notificationProvider}
routerProvider={routerBindings}
resources={[
{
name: "users",
list: "/users",
show: "/users/show/:id",
create: "/Users/createUser",
edit: "/users/edit/:id",
meta: {
canDelete: true,
},
},
]}
options={{
syncWithLocation: true,
warnWhenUnsavedChanges: true,
useNewQueryKeys: true,
}}
>
it unable to find the
src\pages\Users\createUser.tsx