Skip to content

Commit

Permalink
Merge pull request #2 from toriqahmads/fix-count-perpage
Browse files Browse the repository at this point in the history
fix count perpage
  • Loading branch information
toriqahmads authored Oct 2, 2019
2 parents 20af503 + 2453be8 commit d78729f
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 d78729f

Please sign in to comment.