How do you get to display a count of a "ReferenceManyField" component?
Here is the thing, I am listing organizations and I would like to get each of them their users counts.
Fetch organizations:
GET /organizations?filter={}&range=[0,24]&sort=["name","ASC"]
Fetch users for each organizations:
...
GET /users?filter={"uuid_organization":"1117b0a0-6ec7-40e3-9ee6-49d121c27111"}&range=[0,99]&sort=["email","ASC"]
...
<List
{...props}
filters={<OrganizationFilter />}
sort={{ field: 'name', order: 'ASC' }}
perPage={25}
>
<Responsive
xsmall={<MobileGrid />}
medium={
<Datagrid expand={<OrganizationShow />}>
<OrganizationLinkField />
<ReferenceManyField label="Users" reference="users" target="uuid_organization" sort={{ field: 'email', order: 'ASC' }}>
// PRINT: 102 users
</ReferenceManyField>
<EditButton />
</Datagrid>
}
/>
</List>
I am not sure if I should do it this way, it seems inefficient and overkill. What you think?
Thanks in advance.