Skip to content

Previous and next page urls in pagination response #9

@willbrowningme

Description

@willbrowningme

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions