Luk Martins
Luk Martins

Reputation: 31

Axios get in scroll pagination

I am trying to do axios.get from Url, for retrieving data, but the page it's paginate with scroll pagination and I require all data .

How can retrieve all data?

Upvotes: 1

Views: 438

Answers (1)

nc_164
nc_164

Reputation: 11

There are two ways to go about it,

  1. If you have control over backend (API), modify the endpoint to return the whole list of data.
  2. If that's not the case, loop the call, use scroll-id for further calls, maintain a list at UI side, and keep doing that until you get no data back. The scroll-id should be in body of the requests, like this,
  {

  "scroll_id" : 
   "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ=="

  }

Upvotes: 1

Related Questions