mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Merge pull request #4630 from chrismeyersfsu/fix-4368_2
handle reload when deleting org card under edit
This commit is contained in:
commit
6c4df56223
@ -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) {
|
||||
|
||||
var action = function() {
|
||||
@ -137,7 +147,11 @@ export default ['$stateParams', '$scope', '$rootScope', '$location',
|
||||
Rest.destroy()
|
||||
.success(function() {
|
||||
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) {
|
||||
ProcessErrors($scope, data, status, null, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user