diff --git a/lab5/data.json b/lab5/data.json index ad2ab04..43b47fe 100644 --- a/lab5/data.json +++ b/lab5/data.json @@ -103,6 +103,12 @@ "handle": "qwerg", "password": "123", "id": 12 + }, + { + "email": "ad121@mail.com", + "handle": "as", + "password": "1", + "id": 13 } ], "lines": [ diff --git a/lab5/src/pages/LoginPage/Components/Login/hooks/LoginHook.jsx b/lab5/src/pages/LoginPage/Components/Login/hooks/LoginHook.jsx index 3c42fad..8d139a7 100644 --- a/lab5/src/pages/LoginPage/Components/Login/hooks/LoginHook.jsx +++ b/lab5/src/pages/LoginPage/Components/Login/hooks/LoginHook.jsx @@ -1,5 +1,5 @@ -import LoginApiService from 'C:/Users/1/Videos/Documents/intprog/Internet_Programmirovanie_Nasyrov_PIbd-23/lab5/src/pages/RegistrationPage/components/service/regapiservice.js'; -import useUser from 'C:/Users/1/Videos/Documents/intprog/Internet_Programmirovanie_Nasyrov_PIbd-23/lab5/src/providers/hooks/UserHook.jsx'; +import LoginApiService from '../../Service/loginapiservice.js'; +import useUser from '../../../../../providers/hooks/UserHook.jsx'; const useSubmit = () => { const { userLogin } = useUser(); diff --git a/lab5/src/pages/LoginPage/Components/Login/login.jsx b/lab5/src/pages/LoginPage/Components/Login/login.jsx index ffa4068..fff7d2b 100644 --- a/lab5/src/pages/LoginPage/Components/Login/login.jsx +++ b/lab5/src/pages/LoginPage/Components/Login/login.jsx @@ -1,16 +1,16 @@ import './login.css'; -import useSubmit from 'c:/Users/1/Videos/Documents/intprog/Internet_Programmirovanie_Nasyrov_PIbd-23/lab5/src/pages/LoginPage/Components/Login/hooks/LoginHook'; import { useForm } from 'react-hook-form'; import { useNavigate } from 'react-router-dom'; +import useSubmit from './hooks/LoginHook.jsx'; const Login = () => { // const { userLogin } = useUser(); const { register, handleSubmit, formState: { errors } } = useForm(); + const {onSubmit} = useSubmit(); console.log(errors); const navigate = useNavigate(); - const {onSubmit} = useSubmit; - + const makeSubmit = async (data) => { const res1 = await onSubmit(data); if (res1 === 1) { diff --git a/lab5/src/pages/RegistrationPage/components/reg/hooks/regis.jsx b/lab5/src/pages/RegistrationPage/components/reg/hooks/regis.jsx index df2cf93..bb36982 100644 --- a/lab5/src/pages/RegistrationPage/components/reg/hooks/regis.jsx +++ b/lab5/src/pages/RegistrationPage/components/reg/hooks/regis.jsx @@ -1,5 +1,5 @@ -import useUser from 'C:/Users/1/Videos/Documents/intprog/Internet_Programmirovanie_Nasyrov_PIbd-23/lab5/src/providers/hooks/UserHook.jsx'; -import RegApiService from 'C:/Users/1/Videos/Documents/intprog/Internet_Programmirovanie_Nasyrov_PIbd-23/lab5/src/pages/RegistrationPage/components/service/regapiservice'; +import useUser from '../../../../../providers/hooks/UserHook.jsx'; +import RegApiService from '../../Service/regapiservice.js'; const useSubmit = () => { const { userLogin } = useUser(); diff --git a/lab5/src/pages/RegistrationPage/components/reg/reg.jsx b/lab5/src/pages/RegistrationPage/components/reg/reg.jsx index 4c919aa..e833ac9 100644 --- a/lab5/src/pages/RegistrationPage/components/reg/reg.jsx +++ b/lab5/src/pages/RegistrationPage/components/reg/reg.jsx @@ -9,7 +9,7 @@ const Reg = () => { const { register, handleSubmit, formState: { errors } } = useForm(); console.log(errors); const navigate = useNavigate(); - const { onSubmit } = useSubmit; + const { onSubmit } = useSubmit(); const makeSubmit = async (data) => { const res = await onSubmit(data); if (res === 1) {