1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Merge pull request #2082 from mabashian/2075-jt-edit-put

Changed jt edit api call from put to patch
This commit is contained in:
Michael Abashian 2018-06-08 15:57:34 -04:00 committed by GitHub
commit 8b543ea0a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -643,22 +643,7 @@ export default
data.ask_credential_on_launch = $scope.ask_credential_on_launch ? $scope.ask_credential_on_launch : false;
data.job_tags = (Array.isArray($scope.job_tags)) ? $scope.job_tags.join() : "";
data.skip_tags = (Array.isArray($scope.skip_tags)) ? $scope.skip_tags.join() : "";
if ($scope.selectedCredentials && $scope.selectedCredentials
.machine && $scope.selectedCredentials
.machine.id) {
data.credential = $scope.selectedCredentials
.machine.id;
} else {
data.credential = null;
}
if ($scope.selectedCredentials && $scope.selectedCredentials
.vault && $scope.selectedCredentials
.vault.id) {
data.vault_credential = $scope.selectedCredentials
.vault.id;
} else {
data.vault_credential = null;
}
data.extra_vars = ToJSON($scope.parseType,
$scope.extra_vars, true);
@ -699,13 +684,8 @@ export default
data.job_tags = (Array.isArray($scope.job_tags)) ? _.uniq($scope.job_tags).join() : "";
data.skip_tags = (Array.isArray($scope.skip_tags)) ? _.uniq($scope.skip_tags).join() : "";
// drop legacy 'credential' and 'vault_credential' keys from the update request as they will
// be provided to the related credentials endpoint by the template save success handler.
delete data.credential;
delete data.vault_credential;
Rest.setUrl(defaultUrl + $state.params.job_template_id);
Rest.put(data)
Rest.patch(data)
.then(({data}) => {
$scope.$emit('templateSaveSuccess', data);
})