refine
refine copied to clipboard
[BUG] Inferencer relationInfer issue with accessor key
Describe the bug
I override the field tags with field fieldTransformer
{
key: "tags",
type: "relation",
relation: true,
multiple: true,
resource: { name: "tags", route: "/tags" },
relationInfer: {
accessor: "name",
},
accessor: "id",
},
And If the record's tag array does not have any item, the next records on the list does not mapped with the accessor key.
{
"id": 1,
"title": "1111123dasdasd",
"content": "adasdasdasd",
"published": true,
"authorId": null,
"categoryId": 2,
"tags": [
],
}
Also on the show page, it says "not-handled - relation with multiple but no resource"
Steps To Reproduce
To solve this I have made some changes to the file while debugging
.../packages/inferencer/src/inferencers/mui/show.tsx
.../packages/inferencer/src/use-relation-fetch/index.ts
Expected behavior
When the array of a key does not have any item, it should show empty view.
Screenshot
No response
Desktop
No response
Mobile
- UI Framework: MUI
Additional Context
No response
Hi, @BatuhanW,
I created a PR to solve this issue. You can check it here #4498