⚡ Upgrade design & moved backend here & login and settings work with api
This commit is contained in:
@@ -17,19 +17,16 @@ export const useActions = ({ setError, setIsLoading }) => {
|
||||
|
||||
setIsLoading(true);
|
||||
try {
|
||||
const request = await fetch(
|
||||
'https://lovemap-backend.vercel.app/auth/login',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username,
|
||||
password,
|
||||
}),
|
||||
}
|
||||
);
|
||||
const request = await fetch('/api/auth/login', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username,
|
||||
password,
|
||||
}),
|
||||
});
|
||||
|
||||
const response = await request.json();
|
||||
|
||||
@@ -44,7 +41,6 @@ export const useActions = ({ setError, setIsLoading }) => {
|
||||
return;
|
||||
}
|
||||
if (request.status == 500) {
|
||||
console.log('request.status: ', request.status);
|
||||
setError('Erreur interne. Veuillez réessayer');
|
||||
setIsLoading(false);
|
||||
return;
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useActions } from './hooks/useActions';
|
||||
|
||||
// ------------------------------------------------- Assets & Styles ---------------------------------------------------
|
||||
import Loader from '@/assets/Loader';
|
||||
import '../styles.scss';
|
||||
import './styles.scss';
|
||||
// ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
const Login = () => {
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
gap: 15px;
|
||||
gap: 20px;
|
||||
|
||||
& > .error {
|
||||
text-align: center;
|
||||
Reference in New Issue
Block a user