From 41d07f069b013b6b29e76a0ff0ec468effd4c19a Mon Sep 17 00:00:00 2001 From: tonym Date: Thu, 15 Jan 2026 23:35:56 -0600 Subject: [PATCH] fix(home): correct pagination property and type annotations - Use 'currentPage' instead of 'current' for pagination - Remove explicit ISpool type on filter callback (inferred) - Add type assertion for Table dataSource Co-Authored-By: Claude Opus 4.5 --- client/src/pages/home/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/pages/home/index.tsx b/client/src/pages/home/index.tsx index 9136dfa..e33891b 100644 --- a/client/src/pages/home/index.tsx +++ b/client/src/pages/home/index.tsx @@ -33,7 +33,7 @@ export const Home: React.FC = () => { // Fetch all spools (not archived) for the main list const { result: spoolsResult, query: spoolsQuery } = useList({ resource: "spool", - pagination: { current: currentPage, pageSize }, + pagination: { currentPage, pageSize }, sorters: [{ field: "last_used", order: "desc" }], meta: { queryParams: { @@ -54,9 +54,9 @@ export const Home: React.FC = () => { // Calculate low stock spools const lowStockCount = useMemo(() => { - if (!spoolsResult?.data) return 0; - return spoolsResult.data.filter( - (spool: ISpool) => spool.remaining_weight !== undefined && spool.remaining_weight < LOW_STOCK_THRESHOLD + const data = spoolsResult?.data || []; + return data.filter( + (spool) => spool.remaining_weight !== undefined && spool.remaining_weight < LOW_STOCK_THRESHOLD ).length; }, [spoolsResult?.data]); @@ -191,8 +191,8 @@ export const Home: React.FC = () => { extra={{t("buttons.viewAll")}} styles={{ body: { padding: 0 } }} > - + dataSource={spoolsResult?.data as ISpool[]} columns={spoolColumns} rowKey="id" loading={spoolsQuery.isLoading}