VORKOUT-8 #13

Merged
vlad.dev merged 30 commits from VORKOUT-8 into master 2025-07-02 12:23:44 +05:00
4 changed files with 18 additions and 3 deletions
Showing only changes of commit aae56a8c73 - Show all commits

View File

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

View File

@ -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<AllUser>['onChange'] = (pagination) => {
console.log(pagination);
UserService.getUsers(pagination.current as number, 10).then((data) => {
setAccounts(data);
});
};
return (
<>
<Header
@ -121,9 +129,14 @@ export default function AccountsPage() {
}
/>
<Table
onChange={onTableChange}
columns={columns}
dataSource={accounts.users}
pagination={{ pageSize: 10, current: 1, total: accounts.amountCount }}
pagination={{
pageSize: 10,
current: accounts.currentPage,
total: accounts.amountCount,
}}
rowKey={'id'}
/>

View File

@ -191,6 +191,8 @@ export interface components {
amountCount: number;
/** Amountpages */
amountPages: number;
/** Currentpage */
currentPage: number;
};
/** Auth */
Auth: {

View File

@ -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'];