миру мир
This commit is contained in:
parent
f1526ec9e8
commit
e28bd5d75b
@ -103,6 +103,12 @@
|
||||
"handle": "qwerg",
|
||||
"password": "123",
|
||||
"id": 12
|
||||
},
|
||||
{
|
||||
"email": "ad121@mail.com",
|
||||
"handle": "as",
|
||||
"password": "1",
|
||||
"id": 13
|
||||
}
|
||||
],
|
||||
"lines": [
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user