feat: #8023, allow wildcard search for uid/email

This commit is contained in:
Barış Soner Uşaklı
2020-07-09 23:57:54 -04:00
parent 4e9743abb3
commit 3dcf538773
7 changed files with 118 additions and 40 deletions

View File

@@ -37,9 +37,9 @@ module.exports = function (User) {
};
if (paginate) {
var resultsPerPage = meta.config.userSearchResultsPerPage;
var start = Math.max(0, page - 1) * resultsPerPage;
var stop = start + resultsPerPage;
const resultsPerPage = data.resultsPerPage || meta.config.userSearchResultsPerPage;
const start = Math.max(0, page - 1) * resultsPerPage;
const stop = start + resultsPerPage;
searchResult.pageCount = Math.ceil(uids.length / resultsPerPage);
uids = uids.slice(start, stop);
}