Support username search in user listing api

This commit is contained in:
Johannes Zellner
2019-01-15 17:21:40 +01:00
parent 6d8fdb131f
commit 13fac3072d
4 changed files with 32 additions and 12 deletions

View File

@@ -315,12 +315,13 @@ function getAll(callback) {
});
}
function getAllPaged(page, perPage, callback) {
function getAllPaged(search, page, perPage, callback) {
assert(typeof search === 'string' || search === null);
assert.strictEqual(typeof page, 'number');
assert.strictEqual(typeof perPage, 'number');
assert.strictEqual(typeof callback, 'function');
userdb.getAllWithGroupIdsPaged(page, perPage, function (error, results) {
userdb.getAllWithGroupIdsPaged(search, page, perPage, function (error, results) {
if (error) return callback(new UsersError(UsersError.INTERNAL_ERROR, error));
return callback(null, results);