1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #6117 from keithjgrant/6095-redirect-after-host-delete

Fix redirect after host delete

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2020-02-28 00:45:05 +00:00 committed by GitHub
commit a8a45fca84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,10 @@ function HostDetail({ host, i18n, onUpdateHost }) {
try {
await HostsAPI.destroy(id);
setIsloading(false);
history.push(`/inventories/inventory/${inventoryId}/hosts`);
const url = pathname.startsWith('/inventories')
? `/inventories/inventory/${inventoryId}/hosts/`
: `/hosts`;
history.push(url);
} catch (err) {
setDeletionError(err);
}