add name param in updateUser util
This commit is contained in:
@@ -91,16 +91,16 @@ export const logout = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
export const updateUser = async (email?: string, password?: string) => {
|
||||
export const updateUser = async (name?: string, email?: string, password?: string) => {
|
||||
try {
|
||||
if (!email && !password) return;
|
||||
if (!name && !email && !password) return;
|
||||
const res = await fetch(`${API_URL}/v1/auth/`, {
|
||||
method: "PATCH",
|
||||
credentials: "include",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({ email, password })
|
||||
body: JSON.stringify({ name, email, password })
|
||||
});
|
||||
if (res.status === 200) {
|
||||
const user: User = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user