mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
Merge pull request #4630 from chrismeyersfsu/fix-4368_2
handle reload when deleting org card under edit
This commit is contained in:
@@ -127,6 +127,16 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function isDeletedOrganizationBeingEdited(deleted_organization_id, editing_organization_id) {
|
||||||
|
if (editing_organization_id === undefined) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (deleted_organization_id === editing_organization_id) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$scope.deleteOrganization = function(id, name) {
|
$scope.deleteOrganization = function(id, name) {
|
||||||
|
|
||||||
var action = function() {
|
var action = function() {
|
||||||
@@ -137,7 +147,11 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
|||||||
Rest.destroy()
|
Rest.destroy()
|
||||||
.success(function() {
|
.success(function() {
|
||||||
Wait('stop');
|
Wait('stop');
|
||||||
$state.reload('organizations');
|
if (isDeletedOrganizationBeingEdited(id, parseInt($stateParams.organization_id)) === true) {
|
||||||
|
$state.go('^', null, { reload: true });
|
||||||
|
} else {
|
||||||
|
$state.reload('organizations');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.error(function(data, status) {
|
.error(function(data, status) {
|
||||||
ProcessErrors($scope, data, status, null, {
|
ProcessErrors($scope, data, status, null, {
|
||||||
|
|||||||
Reference in New Issue
Block a user