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

Preconfigured login url

parent 07511467
No related branches found
No related tags found
1 merge request!11Basic implementation of login page
......@@ -35,6 +35,15 @@ export const Form: React.FC = () => {
};
const [formValues, setFormValues] = useState<formData>(defaultValues);
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: formValues.email,
password: formValues.password,
}),
};
const handleSubmit = (event: React.FormEvent): void => {
event.preventDefault();
const errors: Array<string> = [];
......@@ -43,6 +52,10 @@ export const Form: React.FC = () => {
console.log('Email address not valid');
} else {
console.log(formValues);
fetch(
'https://jsonplaceholder.typicode.com/posts',
requestOptions,
).then((response) => response.json());
}
};
......
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