⚡ Upgrade design & moved backend here & login and settings work with api
This commit is contained in:
@@ -7,21 +7,18 @@ export const useData = () => {
|
||||
(async () => {
|
||||
const token = localStorage.getItem('token');
|
||||
|
||||
const request = await fetch(
|
||||
'https://lovemap-backend.vercel.app/user',
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: token,
|
||||
},
|
||||
}
|
||||
);
|
||||
const request = await fetch('/api/user', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: token,
|
||||
},
|
||||
});
|
||||
|
||||
const response = await request.json();
|
||||
|
||||
const formattedResponse = {
|
||||
...response.user,
|
||||
createdat: new Date(response.user.createdat).toLocaleDateString(
|
||||
...response,
|
||||
createdat: new Date(response.createdat).toLocaleDateString(
|
||||
'fr-FR'
|
||||
),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user