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 || '',
|
sortBy: req.query.sortBy || meta.config.searchDefaultSortBy || '',
|
||||||
sortDirection: req.query.sortDirection,
|
sortDirection: req.query.sortDirection,
|
||||||
page: page,
|
page: page,
|
||||||
|
itemsPerPage: req.query.itemsPerPage,
|
||||||
uid: req.uid,
|
uid: req.uid,
|
||||||
qs: req.query,
|
qs: req.query,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ function searchInContent(data, callback) {
|
|||||||
next(null, Object.assign({
|
next(null, Object.assign({
|
||||||
posts: posts,
|
posts: posts,
|
||||||
matchCount: matchCount,
|
matchCount: matchCount,
|
||||||
pageCount: Math.max(1, Math.ceil(parseInt(matchCount, 10) / 10)),
|
pageCount: Math.max(1, Math.ceil(parseInt(matchCount, 10) / itemsPerPage)),
|
||||||
}, metadata));
|
}, metadata));
|
||||||
},
|
},
|
||||||
], callback);
|
], callback);
|
||||||
|
|||||||
Reference in New Issue
Block a user