Add Client.getApp that uses REST API

This commit is contained in:
Girish Ramakrishnan
2018-06-25 18:55:07 -07:00
parent a77918bef9
commit 091663afe0
3 changed files with 13 additions and 6 deletions

View File

@@ -735,6 +735,13 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
};
Client.prototype.getApp = function (appId, callback) {
get('/api/v1/apps/' + appId).success(function (data, status) {
if (status !== 200 || typeof data !== 'object') return callback(new ClientError(status, data));
callback(null, data);
}).error(defaultErrorHandler(callback));
};
Client.prototype.getCachedApp = function (appId, callback) {
var appFound = null;
this._installedApps.some(function (app) {
if (app.id === appId) {