Skip to content

Commit

Permalink
Merge pull request #5 from toriqahmads/master
Browse files Browse the repository at this point in the history
Fix count per page result
  • Loading branch information
gcphost authored Oct 2, 2019
2 parents 2b62922 + d78729f commit 7486cfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module.exports = function simplePaginationPlugin(bookshelf) {
pagination: {
count_total: totals,
page_total: Math.ceil(totals / _limit),
count_per_page: hasNextPage ? _limit : total.toJSON()[0].total,
count_per_page: hasNextPage ? _limit : data.length,
per_page: _limit,
current_page: _page,
links: {
Expand Down

0 comments on commit 7486cfa

Please sign in to comment.