Use new route to query user apps
This commit is contained in:
@@ -591,6 +591,13 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.getAppsByUser = function (callback) {
|
||||
get('/api/v1/user/apps').success(function (data, status) {
|
||||
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
|
||||
callback(null, data.apps);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.getAppLogs = function (appId, follow, lines, callback) {
|
||||
if (follow) {
|
||||
var eventSource = new EventSource(client.apiOrigin + '/api/v1/apps/' + appId + '/logstream?lines=' + lines + '&access_token=' + token);
|
||||
@@ -1017,7 +1024,7 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
|
||||
callback = typeof callback === 'function' ? callback : function () {};
|
||||
|
||||
this.getApps(function (error, apps) {
|
||||
this.getAppsByUser(function (error, apps) {
|
||||
if (error) return callback(error);
|
||||
|
||||
// insert or update new apps
|
||||
|
||||
Reference in New Issue
Block a user