/count endpoint is not hit on Virtual Collection

We have virtual collections on django forest, their data source is not our db but we get the data from requesting a source and print on forest admin. Those are also related with our DB objects, like traditional 1:1 or 1:M relations so we have relationships like haveMany in those collections.

It worked for us for a long time but one problem we face is we can’t paginate those collections and pagination do not work for those.

the pagination bottom liner looks always 1 of 0, all items are listed in one page. Also when I check the server, I saw that /resource/count url was not hit.

How does pagination work, how can I tweak it to hit /count route?

Observed behavior

/resource/count is not hit.

Expected behavior

/resource/count should get hit.

Hello
Can you provide the forestadmin dependencies you use and your project name :pray:?
Can you tell us if the count request is sent from the frontend application? You can open the frontend console to check it.
If you use the legacy agent, do you send the count in the metadata like the following example.

res.send({ ...customerStats, meta: { count: count } });

2 Likes

Hi @Alban_Bertolini,

Thank you for reply. I actually spent days to figure it out, even though I read the documentation I apparently skipped that part. I figured out that I wasn’t sending count data in the response.

Thanks!

1 Like