Not calling list api

{
name: "admin/reports",
list: "admin/reports",
meta: {
label: "Reports",
icon: <ProjectOutlined />
},
},
{
name: "admin/reports",
list: "admin/reports",
meta: {
label: "Reports",
icon: <ProjectOutlined />
},
},
import { IResourceComponentsProps } from "@refinedev/core";
import { AntdInferencer } from "@refinedev/inferencer/antd";

export const ReportsList: React.FC<IResourceComponentsProps> = () => {
return <AntdInferencer />;
};
import { IResourceComponentsProps } from "@refinedev/core";
import { AntdInferencer } from "@refinedev/inferencer/antd";

export const ReportsList: React.FC<IResourceComponentsProps> = () => {
return <AntdInferencer />;
};
<Route path="admin/reports">
<Route index element={<ReportsList />} />
</Route>
<Route path="admin/reports">
<Route index element={<ReportsList />} />
</Route>
API is not called
5 Replies
kapa.ai
kapa.ai9mo ago
Hi @tads8799. 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 seems like you're trying to use the AntdInferencer component from @refinedev/inferencer/antd to automatically generate views for your "admin/reports" resource. However, you're not seeing any API calls being made. One possible issue could be the way you're defining your resource in the resources prop of the Refine component. In the examples provided in the extracts, the list property of the resource object is set to the API endpoint for that resource. For example:
resources={[
{
name: "samples",
list: "/samples",
},
]}
resources={[
{
name: "samples",
list: "/samples",
},
]}
In your case, you've set the list property to "admin/reports", which might not be the correct API endpoint for your "admin/reports" resource. You should ensure that the list property is set to the correct API endpoint for fetching the list of reports. If the issue persists, it would be helpful to check the network tab in your browser's developer tools to see if any API requests are being made when the ReportsList component is rendered. If no requests are being made, there might be an issue with the way your dataProvider is configured. For more information, you can refer to the refine documentation (https://refine.dev/docs). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below
adverse-sapphire
adverse-sapphire9mo ago
No api requests are being made, other apis works normallu @kapa.ai
kapa.ai
kapa.ai9mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- If other API requests are working normally but not for the "admin/reports" resource, it could be due to a few reasons: 1. Incorrect API endpoint: Ensure that the list property in your resource object is set to the correct API endpoint for fetching the list of reports. 2. Issues with the specific API endpoint: There might be issues with the "admin/reports" API endpoint itself. It could be down, or there might be some server-side issues preventing it from responding to requests. 3. Issues with the Data Provider: The data provider you're using might not be correctly configured to handle requests to the "admin/reports" endpoint. Refine uses data providers to communicate with APIs. They act as adapters that make HTTP requests to different APIs and return response data using predefined methods. You can check the configuration of your data provider to ensure it's set up correctly. 4. Issues with the Component: There might be issues with the ReportsList component itself. Ensure that it's correctly using the useGetList hook or other hooks provided by Refine to fetch data from the API. Without more specific information, it's hard to pinpoint the exact issue. I would recommend checking the above points and also looking at any error messages you might be getting in your console or network tab in your browser's developer tools. For more information, you can refer to the refine documentation (https://refine.dev/docs) and the blog post on mocking API calls in React (https://refine.dev/blog/mocking-api-calls-in-react/). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai9mo ago
<@577213996344803338> kapa.ai is still learning and improving, please let us know how it did by reacting below