From 736cd4df360bf5e25c9e6413f1e1f865ad6c0175 Mon Sep 17 00:00:00 2001 From: Alex Corey Date: Mon, 14 Jun 2021 17:15:55 -0400 Subject: [PATCH] refetches smart inventory after edit save --- .../src/screens/Inventory/SmartInventory.jsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/awx/ui_next/src/screens/Inventory/SmartInventory.jsx b/awx/ui_next/src/screens/Inventory/SmartInventory.jsx index d490652138..b198e744d4 100644 --- a/awx/ui_next/src/screens/Inventory/SmartInventory.jsx +++ b/awx/ui_next/src/screens/Inventory/SmartInventory.jsx @@ -28,25 +28,22 @@ function SmartInventory({ setBreadcrumb }) { const match = useRouteMatch('/inventories/smart_inventory/:id'); const { - result: { inventory }, + result: inventory, error: contentError, isLoading: hasContentLoading, request: fetchInventory, } = useRequest( useCallback(async () => { const { data } = await InventoriesAPI.readDetail(match.params.id); - return { - inventory: data, - }; + return data; }, [match.params.id]), - { - inventory: null, - } + + null ); useEffect(() => { fetchInventory(); - }, [fetchInventory]); + }, [fetchInventory, location.pathname]); useEffect(() => { if (inventory) {