Allow non published versions to be shown if explicitly requested

Fixes #468
This commit is contained in:
Johannes Zellner
2015-08-10 16:16:38 +02:00
parent 7168455de3
commit 30b248a0f6
3 changed files with 59 additions and 5 deletions

View File

@@ -63,6 +63,17 @@ angular.module('Application').service('AppStore', ['$http', 'Client', function (
});
};
AppStore.prototype.getAppByIdAndVersion = function (appId, version, callback) {
if (Client.getConfig().apiServerOrigin === null) return callback(new AppStoreError(420, 'Enhance Your Calm'));
$http.get(Client.getConfig().apiServerOrigin + '/api/v1/apps/' + appId + '/versions/' + version).success(function (data, status) {
if (status !== 200) return callback(new AppStoreError(status, data));
return callback(null, data);
}).error(function (data, status) {
return callback(new AppStoreError(status, data));
});
};
AppStore.prototype.getManifest = function (appId, callback) {
if (Client.getConfig().apiServerOrigin === null) return callback(new AppStoreError(420, 'Enhance Your Calm'));