openfun / richie

:pencil: An opensource CMS to build education portals
https://richie.education
MIT License
260 stars 84 forks source link

🐛(frontend) useUnionResource refetch #2401

Closed rlecellier closed 4 months ago

rlecellier commented 4 months ago

eof must be reset on each reset (aka filters changes or query invalidation). If it's not, we can arrive to a point where queries are set to eof === 0 (aka maximum page).

Also, on useUnionResource's fetchEntity function, we can have a case where we're retrieving data from react query cache, juste after a reset(). In that case, we must set eof with the right value, otherwise useUnionResource can try to fetch a page that does't exists and it will blow a error.