diff --git a/web/src/Components/Pages/RegisterPage/RegisterPage.jsx b/web/src/Components/Pages/RegisterPage/RegisterPage.jsx
index 0c0e7b3..bd517c2 100644
--- a/web/src/Components/Pages/RegisterPage/RegisterPage.jsx
+++ b/web/src/Components/Pages/RegisterPage/RegisterPage.jsx
@@ -1,6 +1,7 @@
-import {Button, Col, Flex, Form, Input, Select, Typography} from "antd";
-import {UserOutlined, MailOutlined, LockOutlined} from "@ant-design/icons";
+import {Button, Col, DatePicker, Flex, Form, Input, Select, Tooltip, Typography} from "antd";
+import {UserOutlined, MailOutlined, LockOutlined, InfoCircleOutlined, CalendarOutlined} from "@ant-design/icons";
import useRegisterPage from "./useRegisterPage.js";
+import dayjs from "dayjs";
const {Title, Text} = Typography;
@@ -23,23 +24,9 @@ const RegisterPage = () => {
onFinish={onFinish}
layout="vertical"
>
-
-
-
-
{
{
size="large"
/>
+
+ }
+ format="DD.MM.YYYY"
+ style={{width: "100%"}}
+ size="large"
+ maxDate={dayjs()}
+ />
+
{
size="large"
/>
+
+
+
+
+
{
{
const navigate = useNavigate();
+ const [
+ createUser,
+ {
+ isLoading,
+ isError,
+ }
+ ] = useRegisterUserMutation();
+
const pageContainerStyle = {
width: 450,
padding: 40,
@@ -12,10 +21,30 @@ const useRegisterPage = () => {
backgroundColor: "white",
};
- const onFinish = (values) => {
- console.log('Регистрация:', values);
- message.success('Регистрация выполнена успешно!');
- navigate('/login');
+ const onFinish = async (values) => {
+ const payload = {
+ ...values,
+ birthdate: values.birthdate
+ ? values.birthdate.format("YYYY-MM-DD")
+ : null,
+ };
+ console.log(payload)
+ try {
+ await createUser(payload);
+
+ notification.success({
+ title: "Успешно",
+ message: "Пользователь успешно создан",
+ placement: "topRight",
+ })
+ navigate('/login');
+ } catch {
+ notification.error({
+ title: "Ошибка",
+ message: "Пользователь не создан",
+ placement: "topRight",
+ })
+ }
};
return {