show page

for some resource, I am not giving a show page. so in the list page I want to check whether this resource has a show apge or not
4 Replies
kapa.ai
kapa.ai14mo ago
Hi @alfaz_muhammed. 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, there isn't a direct way to check if a resource has a show page or not. However, you can infer this information based on how you've configured your resources in the <Refine> component. In the <Refine> component, you define your resources and their corresponding paths. If you've assigned a value to the show property of a resource, then that resource has a show page. The value assigned to the show property is treated as the show action path for the resource and the navigation operations will be performed on this path. Here's an example of how you might define your resources:
<Refine
resources={[
{
name: "posts",
list: PostList,
create: PostCreate,
edit: PostEdit,
show: PostShow, // If this line is present, then the 'posts' resource has a 'show' page
},
]}
/>
<Refine
resources={[
{
name: "posts",
list: PostList,
create: PostCreate,
edit: PostEdit,
show: PostShow, // If this line is present, then the 'posts' resource has a 'show' page
},
]}
/>
In this example, the posts resource has a show page because the show property is assigned a value (PostShow). If the show property is not assigned a value, then the resource does not have a show page. Please note that this is a simplified explanation and the actual implementation might be more complex depending on your application's requirements and configuration. For more information, you can refer to the Refine documentation (https://refine.dev/docs/api-reference/core/components/refine-config). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai14mo ago
<@763439201353596968> kapa.ai is still learning and improving, please let us know how it did by reacting below
fascinating-indigo
fascinating-indigo14mo ago
Hey @alfaz_muhammed, You can use the useResource hook. https://refine.dev/docs/api-reference/core/hooks/resource/useResource/
fascinating-indigo
fascinating-indigo14mo ago
@salihozdemir yh, that's right. thanks