top level resources defining custom meta data value
on the top level resources defining custom meta data value will this make its wasy down to the data provider i am wanting to keep the resource name simple but passing resourceRoute
{
name: "bankAccounts",
show: "/accountsAndWallets/bankAccounts/show/:id",
meta: {
icon: <></>,
parent: "accountsAndWallets",
label: "Bank Accounts",
resourceRoute: "test/bankAccounts",
},
},
2 Replies
Hi @Joe Gaffney. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, you can define custom metadata values at the top level of your resources, and these values will be accessible in the data provider. The
meta
property is designed to store additional information about the resource, and it can be used to pass custom data to the data provider methods.
Here is an example of how you can define a resource with custom metadata and access it in the data provider:
Defining the Resource with Custom Metadata
Accessing the Metadata in the Data Provider
You can access the meta
property in your data provider methods. Here is an example of how you might do this:
In this example, the resourceRoute
value defined in the meta
property of the resource is accessed within the custom
method of the data provider.
For more information on how to use the meta
property, you can refer to the meta section of the General Concepts documentation (https://refine.dev/docs/guides-concepts/general-concepts/#meta-concept) and the useCustomMutation hook documentation (https://refine.dev/docs/data/hooks/use-custom-mutation/#meta).
By using the meta
property, you can pass any additional information you need to the data provider, making it a flexible solution for customizing your data handling logic.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@422289470487003153> kapa.ai is still learning and improving, please let us know how it did by reacting below