From c180b3c302f3946fd6a81880508bc7b80f60ccb2 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 8 Sep 2023 17:07:08 -0300 Subject: [PATCH] Changed error handling and conditions --- src/frontend/src/controllers/API/index.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index b7aaf8a00..091680fe5 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -464,8 +464,6 @@ export async function updateUser(user_id: string, user: changeUser) { const res = await api.patch(`${BASE_URL_API}users/${user_id}`, user); if (res.status === 200) { return res.data; - } else { - throw new Error(res.data.toString()); } } catch (error) { console.log("Error:", error); @@ -478,8 +476,6 @@ export async function resetPassword(user_id: string, user: resetPasswordType) { const res = await api.patch(`${BASE_URL_API}users/${user_id}/reset-password`, user); if (res.status === 200) { return res.data; - } else { - throw new Error(res.data.toString()); } } catch (error) { console.log("Error:", error);