VORKOUT-8 #13
2
Makefile
2
Makefile
@ -64,5 +64,5 @@ check-api:
|
|||||||
poetry run ruff format . --check
|
poetry run ruff format . --check
|
||||||
|
|
||||||
regenerate-openapi-local:
|
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
|
npx openapi-typescript http://localhost:8000/openapi -o client/src/types/openapi-types.ts
|
||||||
|
@ -19,6 +19,7 @@ export default function AccountsPage() {
|
|||||||
amountCount: 0,
|
amountCount: 0,
|
||||||
amountPages: 0,
|
amountPages: 0,
|
||||||
users: [],
|
users: [],
|
||||||
|
currentPage: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header
|
<Header
|
||||||
@ -121,9 +129,14 @@ export default function AccountsPage() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Table
|
<Table
|
||||||
|
onChange={onTableChange}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={accounts.users}
|
dataSource={accounts.users}
|
||||||
pagination={{ pageSize: 10, current: 1, total: accounts.amountCount }}
|
pagination={{
|
||||||
|
pageSize: 10,
|
||||||
|
current: accounts.currentPage,
|
||||||
|
total: accounts.amountCount,
|
||||||
|
}}
|
||||||
rowKey={'id'}
|
rowKey={'id'}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
@ -191,6 +191,8 @@ export interface components {
|
|||||||
amountCount: number;
|
amountCount: number;
|
||||||
/** Amountpages */
|
/** Amountpages */
|
||||||
amountPages: number;
|
amountPages: number;
|
||||||
|
/** Currentpage */
|
||||||
|
currentPage: number;
|
||||||
};
|
};
|
||||||
/** Auth */
|
/** Auth */
|
||||||
Auth: {
|
Auth: {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { components } from './openapi-types';
|
import { components } from "./openapi-types";
|
||||||
|
|
||||||
export type User = components['schemas']['User'];
|
export type User = components['schemas']['User'];
|
||||||
export type AllUserResponse = components['schemas']['AllUserResponse'];
|
export type AllUserResponse = components['schemas']['AllUserResponse'];
|
||||||
|
Loading…
Reference in New Issue
Block a user