diff --git a/webadmin/src/js/client.js b/webadmin/src/js/client.js index 43a4c007f..b0071c6e6 100644 --- a/webadmin/src/js/client.js +++ b/webadmin/src/js/client.js @@ -591,8 +591,9 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification', }).error(defaultErrorHandler(callback)); }; - Client.prototype.migrate = function (plan, region, password, callback) { - $http.post(client.apiOrigin + '/api/v1/cloudron/migrate', { size: plan.slug, name: plan.name, price: plan.price, region: region, password: password }).success(function(data, status) { + Client.prototype.migrate = function (options, password, callback) { + options.password = password; + $http.post(client.apiOrigin + '/api/v1/cloudron/migrate', options).success(function(data, status) { if (status !== 202 || typeof data !== 'object') return callback(new ClientError(status, data)); callback(null, data); }).error(defaultErrorHandler(callback)); diff --git a/webadmin/src/views/settings.js b/webadmin/src/views/settings.js index b41e0c7a9..4989b375d 100644 --- a/webadmin/src/views/settings.js +++ b/webadmin/src/views/settings.js @@ -172,7 +172,14 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca $scope.doChangePlan = function () { $scope.planChange.busy = true; - Client.migrate($scope.planChange.requestedPlan, $scope.currentRegionSlug, $scope.planChange.password, function (error) { + var options = { + size: $scope.planChange.requestedPlan.slug, + name: $scope.planChange.requestedPlan.name, + price: $scope.planChange.requestedPlan.price, + region: $scope.currentRegionSlug + }; + + Client.migrate(options, $scope.planChange.password, function (error) { $scope.planChange.busy = false; if (error) {