Skip to content

last link incorrectly populated when result is empty #88

@richardlay

Description

@richardlay

When upgrading from 3.0.0 to 4.0.0, my test for when the result is empty broke.

In 3.0.0 the meta.last field was not populated. This is what meta looks like:

{
  count: 0,
  pageCount: 0,
  totalCount: 0,
  next: null,
  previous: null,
  self: 'http://localhost:3000/testPagination?page=1&limit=25',
  first: 'http://localhost:3000/testPagination?page=1&limit=25',
  last: null
}

In 4.0.0 the meta.last field has a 0 indexed link. This is what meta looks like:

{
  count: 0,
  pageCount: 0,
  totalCount: 0,
  next: null,
  previous: null,
  self: 'http://localhost:3000/testPagination?page=1&limit=25',
  first: 'http://localhost:3000/testPagination?page=1&limit=25',
  last: 'http://localhost:3000/testPagination?page=0&limit=25'
}

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