mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 19:46:01 +01:00
fix pageCount calculation
This commit is contained in:
@@ -387,7 +387,7 @@ topicsController.pagination = function (req, res, callback) {
|
||||
}
|
||||
|
||||
var postCount = parseInt(results.topic.postcount, 10);
|
||||
var pageCount = Math.max(1, Math.ceil((postCount - 1) / results.settings.postsPerPage));
|
||||
var pageCount = Math.max(1, Math.ceil(postCount / results.settings.postsPerPage));
|
||||
|
||||
var paginationData = pagination.create(currentPage, pageCount);
|
||||
paginationData.rel.forEach(function (rel) {
|
||||
|
||||
Reference in New Issue
Block a user