From fa767d16cb86848ec80c1969443d60615a146e2b Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 17 Nov 2024 14:33:35 -0500 Subject: [PATCH] Add UpdatePassword function to Fetcher.jsx --- src/utils/Fetcher.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/utils/Fetcher.jsx b/src/utils/Fetcher.jsx index 106f17d..3310d87 100644 --- a/src/utils/Fetcher.jsx +++ b/src/utils/Fetcher.jsx @@ -21,6 +21,14 @@ const signUp = (username, password, displayName, email) => { }) } +const UpdatePassword = newPassword => { + return fetch(`${API_URL}/users/change_password`, { + method: 'PUT', + headers: HEADERS(), + body: JSON.stringify({ password: newPassword }), + }) +} + const login = (username, password) => { return fetch(`${API_URL}/auth/login`, { headers: { @@ -322,6 +330,7 @@ export { UpdateChoreAssignee, UpdateChoreHistory, UpdateChorePriority, + UpdatePassword, UpdateThingState, UpdateUserDetails, }