diff --git a/Makefile b/Makefile index 3f4dab6..241334c 100644 --- a/Makefile +++ b/Makefile @@ -64,5 +64,5 @@ check-api: poetry run ruff format . --check regenerate-openapi-local: - rm client/src/types/openapi-types.types \ + rm client/src/types/openapi-types.ts \ npx openapi-typescript http://localhost:8000/openapi -o client/src/types/openapi-types.ts diff --git a/client/src/pages/AccountsPage.tsx b/client/src/pages/AccountsPage.tsx index aa67ac7..f94ad6c 100644 --- a/client/src/pages/AccountsPage.tsx +++ b/client/src/pages/AccountsPage.tsx @@ -19,6 +19,7 @@ export default function AccountsPage() { amountCount: 0, amountPages: 0, users: [], + currentPage: 1, }); useEffect(() => { @@ -103,6 +104,13 @@ export default function AccountsPage() { }, ]; + const onTableChange: TableProps['onChange'] = (pagination) => { + console.log(pagination); + UserService.getUsers(pagination.current as number, 10).then((data) => { + setAccounts(data); + }); + }; + return ( <>
diff --git a/client/src/types/openapi-types.ts b/client/src/types/openapi-types.ts index b23e43f..1e14c6c 100644 --- a/client/src/types/openapi-types.ts +++ b/client/src/types/openapi-types.ts @@ -191,6 +191,8 @@ export interface components { amountCount: number; /** Amountpages */ amountPages: number; + /** Currentpage */ + currentPage: number; }; /** Auth */ Auth: { diff --git a/client/src/types/user.ts b/client/src/types/user.ts index 0c20246..ef49e4a 100644 --- a/client/src/types/user.ts +++ b/client/src/types/user.ts @@ -1,4 +1,4 @@ -import { components } from './openapi-types'; +import { components } from "./openapi-types"; export type User = components['schemas']['User']; export type AllUserResponse = components['schemas']['AllUserResponse'];