clone: Do not send disabled ports

fixes cloudron/box#611
This commit is contained in:
Girish Ramakrishnan
2019-01-24 10:05:59 -08:00
parent 318ee89e89
commit 998c9bdeb7

View File

@@ -281,10 +281,18 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
clone: function () {
$scope.appRestore.busy = true;
// only use enabled ports from portBindings
var finalPortBindings = {};
for (var env in $scope.appRestore.portBindings) {
if ($scope.appRestore.portBindingsEnabled[env]) {
finalPortBindings[env] = $scope.appRestore.portBindings[env];
}
}
var data = {
location: $scope.appRestore.location,
domain: $scope.appRestore.domain.domain,
portBindings: $scope.appRestore.portBindings,
portBindings: finalPortBindings,
backupId: $scope.appRestore.selectedBackup.id
};