⚡ 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;
|
||||
|
||||
Reference in New Issue
Block a user