Skip to content

Add Count of Records to Pagination#29

Merged
stas merged 2 commits intostas:masterfrom
mevo-limited:master
Nov 26, 2020
Merged

Add Count of Records to Pagination#29
stas merged 2 commits intostas:masterfrom
mevo-limited:master

Conversation

@FinnLawrence
Copy link
Contributor

What is the current behavior?

Currently, the pagination doesn't return the total number of records, which can be required on the client-side to generate pagination metadata, e.g. 1-10 of 29 widgets.

This is referenced in #21 and #23 already, and while I agree that the total name proposed in #21 is confusing (could be total of pages?), the proposed solution there effectively replicates the existing functionality in /lib/jsonapi/pagination.rb.

What is the new behavior?

Added a records key to the pagination, that is the total number of records being paginated.

Hopefully, this name is less confusing, and succinctly describes itself.

Checklist

Please make sure the following requirements are complete:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes /
    features)
  • All automated checks pass (CI/CD)

@stas
Copy link
Owner

stas commented Nov 26, 2020

@FinnLawrence I deeply apologize for the delay with this one. I'll get the CI fixed and merge this asap to unlock also other contributions.

Thank you! 🙇

@stas stas merged commit 01db1e9 into stas:master Nov 26, 2020
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

Successfully merging this pull request may close these issues.

2 participants