Speed up user listing by performing parallel requests

This commit is contained in:
Johannes Zellner
2019-01-16 14:02:08 +01:00
parent 4ead9cbf6a
commit adf3172ebb
4 changed files with 44 additions and 14 deletions

View File

@@ -845,9 +845,10 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
});
};
Client.prototype.getUsers = function (page, perPage, callback) {
if (typeof page === 'function') {
callback = page;
Client.prototype.getUsers = function (search, page, perPage, callback) {
if (typeof search === 'function') {
callback = search;
search = '';
page = 1;
perPage = 1000;
}
@@ -859,6 +860,8 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
}
};
if (search) config.params.search = search;
get('/api/v1/users', config, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));