diff --git a/client/src/lib/auth.ts b/client/src/lib/auth.ts index b20fc1b..1df17b0 100644 --- a/client/src/lib/auth.ts +++ b/client/src/lib/auth.ts @@ -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();