Skip to content
Snippets Groups Projects
Verified Commit 4cb37a08 authored by Defendi Alberto's avatar Defendi Alberto
Browse files

Pre define axios request for sign up

parent a3964bf0
No related branches found
No related tags found
2 merge requests!56Refined auth flow and new website pages.,!40Sign up/Log in form nest into AuthUser
...@@ -3,6 +3,7 @@ import { SubmitHandler, useForm } from 'react-hook-form'; ...@@ -3,6 +3,7 @@ import { SubmitHandler, useForm } from 'react-hook-form';
import { Button } from '@material-ui/core'; import { Button } from '@material-ui/core';
import { InputField } from 'components/AuthUser/InputField/InputField'; import { InputField } from 'components/AuthUser/InputField/InputField';
import { useStyles } from 'components/AuthUser/SignUpForm/useStyles'; import { useStyles } from 'components/AuthUser/SignUpForm/useStyles';
import axios from 'axios';
export const SignUpForm: FC = () => { export const SignUpForm: FC = () => {
interface FormData { interface FormData {
...@@ -18,7 +19,17 @@ export const SignUpForm: FC = () => { ...@@ -18,7 +19,17 @@ export const SignUpForm: FC = () => {
const { control, errors, handleSubmit } = useForm<FormData>(); const { control, errors, handleSubmit } = useForm<FormData>();
const onSubmit: SubmitHandler<FormData> = (values: FormData) => { const onSubmit: SubmitHandler<FormData> = (values: FormData) => {
// Submit data axios.post(
'/api/web/',
{
values,
},
{
headers: {
'Content-Type': 'application/json',
},
},
);
}; };
const classes = useStyles(); const classes = useStyles();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment