миру мир
This commit is contained in:
parent
f1526ec9e8
commit
e28bd5d75b
@ -103,6 +103,12 @@
|
|||||||
"handle": "qwerg",
|
"handle": "qwerg",
|
||||||
"password": "123",
|
"password": "123",
|
||||||
"id": 12
|
"id": 12
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"email": "ad121@mail.com",
|
||||||
|
"handle": "as",
|
||||||
|
"password": "1",
|
||||||
|
"id": 13
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lines": [
|
"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 LoginApiService from '../../Service/loginapiservice.js';
|
||||||
import useUser from 'C:/Users/1/Videos/Documents/intprog/Internet_Programmirovanie_Nasyrov_PIbd-23/lab5/src/providers/hooks/UserHook.jsx';
|
import useUser from '../../../../../providers/hooks/UserHook.jsx';
|
||||||
|
|
||||||
const useSubmit = () => {
|
const useSubmit = () => {
|
||||||
const { userLogin } = useUser();
|
const { userLogin } = useUser();
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
import './login.css';
|
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 { useForm } from 'react-hook-form';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import useSubmit from './hooks/LoginHook.jsx';
|
||||||
|
|
||||||
|
|
||||||
const Login = () => {
|
const Login = () => {
|
||||||
// const { userLogin } = useUser();
|
// const { userLogin } = useUser();
|
||||||
const { register, handleSubmit, formState: { errors } } = useForm();
|
const { register, handleSubmit, formState: { errors } } = useForm();
|
||||||
|
const {onSubmit} = useSubmit();
|
||||||
console.log(errors);
|
console.log(errors);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const {onSubmit} = useSubmit;
|
|
||||||
|
|
||||||
const makeSubmit = async (data) => {
|
const makeSubmit = async (data) => {
|
||||||
const res1 = await onSubmit(data);
|
const res1 = await onSubmit(data);
|
||||||
|
@ -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 useUser from '../../../../../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 RegApiService from '../../Service/regapiservice.js';
|
||||||
|
|
||||||
const useSubmit = () => {
|
const useSubmit = () => {
|
||||||
const { userLogin } = useUser();
|
const { userLogin } = useUser();
|
||||||
|
@ -9,7 +9,7 @@ const Reg = () => {
|
|||||||
const { register, handleSubmit, formState: { errors } } = useForm();
|
const { register, handleSubmit, formState: { errors } } = useForm();
|
||||||
console.log(errors);
|
console.log(errors);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { onSubmit } = useSubmit;
|
const { onSubmit } = useSubmit();
|
||||||
const makeSubmit = async (data) => {
|
const makeSubmit = async (data) => {
|
||||||
const res = await onSubmit(data);
|
const res = await onSubmit(data);
|
||||||
if (res === 1) {
|
if (res === 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user