webadmin: cache also the title from the appstore on app installation

This commit is contained in:
Johannes Zellner
2014-09-09 22:12:39 -07:00
parent 095a3832fc
commit 7ce61bcb1c
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -202,13 +202,14 @@ angular.module('Application').service('Client', function ($http, $filter) {
});
};
Client.prototype.installApp = function (id, password, config, callback) {
Client.prototype.installApp = function (id, password, title, config, callback) {
var that = this;
var data = { appStoreId: id, password: password, location: config.location, portBindings: config.portBindings };
$http.post('/api/v1/app/install', data).success(function (data, status) {
if (status !== 200 || !data.appId) return callback(new ClientError(status, data));
// put in cache
// put new app with amended title in cache
data.manifest = { title: title };
that._installedApps.push(data);
callback(null, data.appId);
+1 -1
View File
@@ -40,7 +40,7 @@ var AppInstallController = function ($scope, $routeParams, Client, AppStore) {
portBindings[port] = $scope.portBindings[port].hostPort;
}
Client.installApp($routeParams.appStoreId, $scope.password, { location: $scope.location, portBindings: portBindings }, function (error, appId) {
Client.installApp($routeParams.appStoreId, $scope.password, $scope.app.title, { location: $scope.location, portBindings: portBindings }, function (error, appId) {
if (error) {
if (error.statusCode === 409) {
$scope.error.name = 'Application already exists.';