<commit_before>ManageIQ.angular.app.controller('mwAddDeploymentController', MwAddDeploymentController);

MwAddDeploymentController.$inject = ['$scope', '$http', 'miqService'];

function MwAddDeploymentController($scope, $http, miqService) {

  $scope.$on('mwAddDeploymentEvent', function(event, data) {

    var fd = new FormData();
    fd.append('file', data.file);
    fd.append('id', data.serverId);
    fd.append('enabled', data.enableDeployment);
    fd.append('runtimeName', data.runtimeName);
    $http.post('/middleware_server/add_deployment', fd, {
      transformRequest: angular.identity,
      headers: {'Content-Type': undefined}
    })
      .then(
        function() { // success
          miqService.miqFlash('success', 'Deployment "' + data.runtimeName + '" has been initiated on this server.');
        },
        function() { // error
          miqService.miqFlash('error', 'Unable to deploy "' + data.runtimeName + '" on this server.');
        })
      .finally(function() {
        angular.element("#modal_d_div").modal('hide');
        miqService.sparkleOff();
      });
  });
}
<commit_msg>Fix Add MW Deployment not working<commit_after>ManageIQ.angular.app.controller('mwAddDeploymentController', MwAddDeploymentController);

MwAddDeploymentController.$inject = ['$scope', '$http', 'miqService'];

function MwAddDeploymentController($scope, $http, miqService) {

  $scope.$on('mwAddDeploymentEvent', function(event, data) {

    var fd = new FormData();
    fd.append('file', data.filePath);
    fd.append('id', data.serverId);
    fd.append('enabled', data.enableDeployment);
    fd.append('runtimeName', data.runtimeName);
    $http.post('/middleware_server/add_deployment', fd, {
      transformRequest: angular.identity,
      headers: {'Content-Type': undefined}
    })
      .then(
        function() { // success
          miqService.miqFlash('success', 'Deployment "' + data.runtimeName + '" has been initiated on this server.');
        },
        function() { // error
          miqService.miqFlash('error', 'Unable to deploy "' + data.runtimeName + '" on this server.');
        })
      .finally(function() {
        angular.element("#modal_d_div").modal('hide');
        miqService.sparkleOff();
      });
  });
}

{'fraction_non_alphanumeric': 0.16163410301953818, 'fraction_numerical': 0.0, 'mean_word_length': 3.4880478087649402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6748483', 'n_tokens_mistral': 677, 'n_tokens_neox': 663, 'n_words': 119}