profil
This commit is contained in:
@ -48,6 +48,12 @@ export type UserCtxT =
|
||||
password: string;
|
||||
}) => Promise<any>,
|
||||
|
||||
updateDog: ({ email, name, phone }: {
|
||||
email: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
}) => Promise<any>,
|
||||
|
||||
loginUser: (
|
||||
{ email, password } :
|
||||
{
|
||||
@ -104,6 +110,24 @@ export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
|
||||
}
|
||||
}
|
||||
|
||||
const updateDog = async ({email, name, phone}:
|
||||
{email: string, name: string, phone: string}) => {
|
||||
setWait(true);
|
||||
try{
|
||||
const {data} = await Axios.post('updateDog.php',{
|
||||
email,
|
||||
name,
|
||||
phone
|
||||
});
|
||||
setWait(false);
|
||||
return data;
|
||||
}
|
||||
catch(err){
|
||||
setWait(false);
|
||||
return {success:0, message:'Server Error!'};
|
||||
}
|
||||
}
|
||||
|
||||
const loginUser = async ({email,password}:{email: string, password: string}) =>
|
||||
{
|
||||
setWait(true);
|
||||
@ -212,6 +236,7 @@ export const UserCtxProvider = ({children}:TUserContextProviderProps) => {
|
||||
<UserCtx.Provider value={
|
||||
{
|
||||
registerUser,
|
||||
updateDog,
|
||||
loginUser,
|
||||
wait,
|
||||
user,
|
||||
|
||||
Reference in New Issue
Block a user