From a60e7a78554eaaf9ac2929b042f59baeac97a7e4 Mon Sep 17 00:00:00 2001 From: Keith Grant Date: Thu, 27 Feb 2020 13:33:34 -0800 Subject: [PATCH] fix redirect url after host delete --- awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx index 7e03abc736..e37ac26b66 100644 --- a/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx +++ b/awx/ui_next/src/screens/Host/HostDetail/HostDetail.jsx @@ -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); }