From 15e5957ecf8a5f5d4636be28c8cc8f8ad712ae71 Mon Sep 17 00:00:00 2001 From: Drew Rautenberg Date: Wed, 5 Feb 2025 11:16:03 -0600 Subject: [PATCH] it works! --- barkmanui/src/features/inventory/InventoryList.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/barkmanui/src/features/inventory/InventoryList.tsx b/barkmanui/src/features/inventory/InventoryList.tsx index 764293f..5a6054c 100644 --- a/barkmanui/src/features/inventory/InventoryList.tsx +++ b/barkmanui/src/features/inventory/InventoryList.tsx @@ -3,11 +3,16 @@ import BarkButton from "../../common/components/BarkButton.tsx"; import {Link, NavLink} from "react-router"; import useInventoryList from "./hooks/useInventoryList.tsx"; + function InventoryList() { - const data = useInventoryList(); + const rawData = useInventoryList(); + if (rawData.isPending) return 'Loading...' + if (rawData.error) return 'An error has occurred: ' + rawData.error.message + + const data = rawData.data return ( <> @@ -25,7 +30,6 @@ function InventoryList() { Add Item -