mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
Make sure to delete any nodes that need to be deleted before attempting to associate
This commit is contained in:
@@ -296,7 +296,11 @@ export default ['$scope', 'WorkflowService', 'generateList', 'TemplateList', 'Pr
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$q.all(disassociatePromises.concat(editNodePromises))
|
let deletePromises = $scope.treeData.data.deletedNodes.map(function(nodeId) {
|
||||||
|
return TemplatesService.deleteWorkflowJobTemplateNode(nodeId);
|
||||||
|
});
|
||||||
|
|
||||||
|
$q.all(disassociatePromises.concat(editNodePromises, deletePromises))
|
||||||
.then(function() {
|
.then(function() {
|
||||||
|
|
||||||
let associatePromises = $scope.associateRequests.map(function(request) {
|
let associatePromises = $scope.associateRequests.map(function(request) {
|
||||||
@@ -307,11 +311,7 @@ export default ['$scope', 'WorkflowService', 'generateList', 'TemplateList', 'Pr
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let deletePromises = $scope.treeData.data.deletedNodes.map(function(nodeId) {
|
$q.all(associatePromises)
|
||||||
return TemplatesService.deleteWorkflowJobTemplateNode(nodeId);
|
|
||||||
});
|
|
||||||
|
|
||||||
$q.all(associatePromises.concat(deletePromises))
|
|
||||||
.then(function() {
|
.then(function() {
|
||||||
$scope.closeDialog();
|
$scope.closeDialog();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user