refetches smart inventory after edit save

This commit is contained in:
Alex Corey 2021-06-14 17:15:55 -04:00 committed by Shane McDonald
parent 8d99f79de4
commit 736cd4df36
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374

View File

@ -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) {