manual-pink
manual-pink11mo ago

Can I use different menu items for the same resources?

resources={[ { name: "post", list: "/post", meta: { label: "My custom post ", }, {name:"post", list:"/post1", meta: { label: "My custom post2", }, }
2 Replies
kapa.ai
kapa.ai11mo ago
Hi @seeme9369. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- It seems like you're trying to define multiple resources for your Refine application. However, there seems to be a syntax error in your code. Each resource should be a separate object within the resources array. Here's how you can define multiple resources:
resources={[
{
name: "post",
list: "/post",
meta: {
label: "My custom post",
},
},
{
name: "post1",
list: "/post1",
meta: {
label: "My custom post2",
},
},
]}
resources={[
{
name: "post",
list: "/post",
meta: {
label: "My custom post",
},
},
{
name: "post1",
list: "/post1",
meta: {
label: "My custom post2",
},
},
]}
Each resource object can have properties like name, list, create, edit, show, and icon as per the Refine documentation (https://refine.dev/blog/refine-react-invoice-generator-3/). The list property is used to assign route paths. If you have multiple resources with the same name, you can pass the identifier instead of the name of the resource. It will only be used as the main matching key for the resource, data provider methods will still work with the name of the resource defined in the <Refine/> component. For more information, refer to the identifier section of the <Refine/> component documentation (https://refine.dev/docs/api-reference/core/components/refine-config/#identifier). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai11mo ago
<@515570518443819018> kapa.ai is still learning and improving, please let us know how it did by reacting below