Upgrade design & moved backend here & login and settings work with api

This commit is contained in:
2024-09-29 18:04:41 +02:00
parent 42d3212624
commit f2d1eb4289
43 changed files with 1881 additions and 359 deletions
+10 -14
View File
@@ -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;
+1 -1
View File
@@ -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;