react-admin ListGuesser 显示"No results found"


My Resource -:
<Resource name="ReliabilityEventLog" list={ListGuesser} />

This is my response from the server_:
{
"data": {
"items": [{
"createdAt": "2020-12-04T04:24:00.118Z",
"deletedAt": null,
"eventName": "Confirmed Withdraw* between 5 and 24 hrs",
"eventDate": "2020-12-04T00:00:00.000Z",
"eventPoint": -20,
"shiftId": 44332,
"facilityName": "Tester Facility Friendswood",
"facilityId": 927,
"id": 4,
"nurseId": 12508,
]}}

ListGuesser呈现";没有发现结果";并且数据是从网络选项卡返回的。

这种行为有什么解释吗?或者如何解决?任何帮助都会被感激。

您的dataProvider.getList()应该返回一个对象,该对象包含"data"键中的记录数组:

{
"data": [{
"createdAt": "2020-12-04T04:24:00.118Z",
"deletedAt": null,
"eventName": "Confirmed Withdraw* between 5 and 24 hrs",
"eventDate": "2020-12-04T00:00:00.000Z",
"eventPoint": -20,
"shiftId": 44332,
"facilityName": "Tester Facility Friendswood",
"facilityId": 927,
"id": 4,
"nurseId": 12508,
}]
}

有关详细信息,请参阅有关dataProvider响应格式的官方react管理文档:

https://marmelab.com/react-admin/DataProviders.html#response-格式化

问题是我的graphQL服务器没有返回查询的计数,因此dataProvider无法成功地对结果进行分页,从而导致无法呈现。

相关内容

  • 没有找到相关文章

最新更新