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

pagination #3

Open
chpio opened this issue Jul 3, 2019 · 1 comment
Open

pagination #3

chpio opened this issue Jul 3, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@chpio
Copy link

chpio commented Jul 3, 2019

The lib seems to not do a transparent pagination to get all the entries. So what is the intended way to get pagination going?

@Burnett01 Burnett01 added the enhancement New feature or request label Oct 1, 2019
@Burnett01
Copy link
Owner

Hello @chpio ,

according to the Moco docs (https://github.com/hundertzehn/mocoapp-api-docs#pagination)
pagination works by adding a page parameter to the request.

I haven't tested this yet, but I think it should work like this:

mycompany.getProjects({
  page: 4
})
.then((results) => {
  console.log(results)
})
.catch((err) => {
  console.log(err)
})

In addition, Moco responds with some X-* headers which aid in paginating through your results.

However, I understand that this library should come up with a built-in solution to paginate through the results effortlessly. This leaves me with some ideas to actually add such feature to this library.
If you want to do it feel free to submit a pull request. Otherwise I'm going to start working on this.

Greetings, Steve

@Burnett01 Burnett01 added the question Further information is requested label Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants