-
-
Notifications
You must be signed in to change notification settings - Fork 172
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 #84
Comments
That would be awesome. |
What's you're looking for is something like .limit() |
Fluent has limit already. Some web frameworks do even more in terms of paging though. |
Maybe this is a bug better filed on Vapor's repository? Maybe some sort of middleware can be created that automatically adds pagination objects to the responses of certain requests? |
@BrettRToomey Is working on this, should be ready soon! |
For some people that is having trouble with this, I just have made a simple workaround for my object named Offer being pageQuantity the quantity of elements per page and the pageNumber the one received on the request
This approach actually performs two fetches to the DB, one for having the total amount of pages Printing description of statement: |
I made a simple wrapper around it few weeks ago https://github.com/mludi/VaporSimplePagination |
Here's what we ended up releasing at Nodes: https://github.com/nodes-vapor/paginator It includes a Leaf tag and is bootstrap compatible. |
Like the collection, just with options for page=2 query
Add a pagination object to the response with
The text was updated successfully, but these errors were encountered: