send complete plan information (since we do not have id)

This commit is contained in:
Girish Ramakrishnan
2016-06-30 12:00:05 -05:00
parent 412243e656
commit 8f7e5f154b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -591,8 +591,8 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}).error(defaultErrorHandler(callback));
};
Client.prototype.migrate = function (size, region, password, callback) {
$http.post(client.apiOrigin + '/api/v1/cloudron/migrate', { size: size, region: region, password: password }).success(function(data, status) {
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) {
if (status !== 202 || typeof data !== 'object') return callback(new ClientError(status, data));
callback(null, data);
}).error(defaultErrorHandler(callback));
+1 -1
View File
@@ -166,7 +166,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.doChangePlan = function () {
$scope.planChange.busy = true;
Client.migrate($scope.requestedPlan.slug, $scope.currentRegionSlug, $scope.planChange.password, function (error) {
Client.migrate($scope.planChange.requestedPlan, $scope.currentRegionSlug, $scope.planChange.password, function (error) {
$scope.planChange.busy = false;
if (error) {