Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Remove call to appeals endpoint with limit=1000 #1969

Open
batpad opened this issue Jul 14, 2021 · 0 comments
Open

Remove call to appeals endpoint with limit=1000 #1969

batpad opened this issue Jul 14, 2021 · 0 comments
Labels
feature New feature master ticket refactor

Comments

@batpad
Copy link
Contributor

batpad commented Jul 14, 2021

We currently call the getAppealsList action in a few places on the frontend. This makes a call to the Appeals API with limit=1000: https://github.com/IFRCGo/go-frontend/blob/develop/src/root/actions/index.js#L232

We seem to call getAppealsList in the appeals-table component where we don't need to and it should be trivial to move to properly paginated API calls :

The one that seems a bit more work to remove is the call inside the presentation-dash component: https://github.com/IFRCGo/go-frontend/blob/develop/src/root/components/connected/presentation-dash.js#L8

This is likely going to be a bit more work since the presentation dash currently needs all appeals to figure out what to display on the map - not sure if this can be helped by creating an endpoint that aggregates by country or so.

This might not be urgent since I see we still receive a total of 66 appeals from the backend, but it is something we should fix since we don't want to allow calls to the API with that high a limit. Perhaps an alternative would be to just use paginated requests as elsewhere to break up the request into multiple chunks.

Would be good to tackle at some point.

cc @tovari

@batpad batpad added the feature New feature master ticket label Jul 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature master ticket refactor
Projects
None yet
Development

No branches or pull requests

1 participant