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

Previous and next page urls in pagination response #9

Closed
willbrowningme opened this issue Nov 7, 2016 · 2 comments
Closed

Previous and next page urls in pagination response #9

willbrowningme opened this issue Nov 7, 2016 · 2 comments

Comments

@willbrowningme
Copy link

When making a query to an end point that returns all the data for the current user if there are no filters but then only returns a subset with filters applied e.g:

http://example.com/api/orders?status=completed&dispatched=1&date_from=01-10-2016&date_to=01-11-2016&page=1

The response pagination data for the next and previous pages do not include any of the filters from the original request, so if using these to change page it will return all the data with no filters.

{
  "data": {
    "total": 100,
    "per_page": 15,
    "current_page": 2,
    "last_page": 7,
    "next_page_url": "http://example.com/api/orders?page=3",
    "prev_page_url": "http://example.com/api/orders?page=1",
    "from": 16,
    "to": 30,
    "data": [.....]
  }
}

Is there a way to make the next_page_url and prev_page_url include all the same filters with simply the page = 2 etc?

@robsontenorio
Copy link

robsontenorio commented Nov 26, 2016

@tttwb See #12
Waiting for @selahattinunlu answer.

selahattinunlu added a commit that referenced this issue Nov 27, 2016
@selahattinunlu
Copy link
Owner

Pagination issue is fixed.

@tttwb I want to say again, I'm so sorry for late.

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

3 participants