fix(home): correct pagination property and type annotations
Some checks failed
CI / style (push) Has been cancelled
CI / build-client (push) Has been cancelled
CI / build-amd64 (push) Has been cancelled
CI / build-tester (push) Has been cancelled
CI / test (cockroachdb) (push) Has been cancelled
CI / test (mariadb) (push) Has been cancelled
CI / test (postgres) (push) Has been cancelled
CI / test (sqlite) (push) Has been cancelled
CI / build-arm64 (push) Has been cancelled
CI / build-armv7 (push) Has been cancelled
CI / publish-images (push) Has been cancelled
CI / publish-release (push) Has been cancelled

- 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 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 23:35:56 -06:00
parent f2fecede35
commit 41d07f069b

View File

@@ -33,7 +33,7 @@ export const Home: React.FC<IResourceComponentsProps> = () => {
// Fetch all spools (not archived) for the main list
const { result: spoolsResult, query: spoolsQuery } = useList<ISpool>({
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<IResourceComponentsProps> = () => {
// 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<IResourceComponentsProps> = () => {
extra={<Link to="/spool">{t("buttons.viewAll")}</Link>}
styles={{ body: { padding: 0 } }}
>
<Table
dataSource={spoolsResult?.data}
<Table<ISpool>
dataSource={spoolsResult?.data as ISpool[]}
columns={spoolColumns}
rowKey="id"
loading={spoolsQuery.isLoading}