mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
add itemsPerPage to search api
This commit is contained in:
@@ -50,6 +50,7 @@ searchController.search = function (req, res, next) {
|
||||
sortBy: req.query.sortBy || meta.config.searchDefaultSortBy || '',
|
||||
sortDirection: req.query.sortDirection,
|
||||
page: page,
|
||||
itemsPerPage: req.query.itemsPerPage,
|
||||
uid: req.uid,
|
||||
qs: req.query,
|
||||
};
|
||||
|
||||
@@ -116,7 +116,7 @@ function searchInContent(data, callback) {
|
||||
next(null, Object.assign({
|
||||
posts: posts,
|
||||
matchCount: matchCount,
|
||||
pageCount: Math.max(1, Math.ceil(parseInt(matchCount, 10) / 10)),
|
||||
pageCount: Math.max(1, Math.ceil(parseInt(matchCount, 10) / itemsPerPage)),
|
||||
}, metadata));
|
||||
},
|
||||
], callback);
|
||||
|
||||
Reference in New Issue
Block a user