Speed up user listing by performing parallel requests
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user