mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 20:51:21 -03:30
refetches smart inventory after edit save
This commit is contained in:
parent
8d99f79de4
commit
736cd4df36
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user