Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination in footprints #12

Open
jamesjwarren opened this issue Mar 21, 2017 · 1 comment
Open

Pagination in footprints #12

jamesjwarren opened this issue Mar 21, 2017 · 1 comment

Comments

@jamesjwarren
Copy link
Contributor

Integrate pagination into the FootprintService.find method using bookshelf's fetchPage method. To support queries like: ?limit=10&page=1

@jamesjwarren
Copy link
Contributor Author

I've noticed in the FootprintService limit is being passed into bookshelf's .query(criteria) method in the criteria object. Trying to use this returns the following error:

error: column "limit" does not exist

Bookshelf doesn't appear to support this and instead the query should be built with the following knex query:

.query((qb) => {
  qb.where(criteria)
  db.limit(10).offset(0)
}

Or alternatively using the pagination plugin with the fetchPage method instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant