This commit is contained in:
2023-01-31 00:09:01 +01:00
parent a861acb2e0
commit 0a89c6aab1
5 changed files with 52 additions and 54 deletions

View File

@ -111,11 +111,7 @@ export const loginUser = async ({email,password}:{email: string, password: strin
});
const {data} = postReturn;
if(data.success && data.data)
{
return {success:1};
}
return {success:0, message:data.message};
return data;
}
catch(err)
{
@ -136,6 +132,7 @@ export const getProfilData = async () =>
return null;
}
}
export const getUser = async () =>
{
const res = await Axios.get('getUser.php');
@ -143,5 +140,19 @@ export const getUser = async () =>
return data;
}
export const logOut = () =>
{
Axios.post('logout.php')
.then((res) =>
{
console.log('Header logout');
console.log(res);
})
.catch((err) => console.error(err));
}
export const sleep = (ms: number) =>
{
return new Promise((resolve) => setTimeout(resolve, ms));
};