Use new route to query user apps

This commit is contained in:
Girish Ramakrishnan
2018-04-26 20:07:53 -07:00
parent 8861e61bdf
commit bfd25a08c2

View File

@@ -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