diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-08-10 02:08:49 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-08-10 02:08:49 -0400 |
commit | e9745683748ac5ecfdf704607441a3204d8c5516 (patch) | |
tree | 34004796c608c7c287402582fc23e2a0c8ba1e86 /src/utils | |
parent | b5f17dc7a6f706a302d01fc129f5bf7edf6d8471 (diff) | |
download | donetick-frontend-e9745683748ac5ecfdf704607441a3204d8c5516.tar.gz donetick-frontend-e9745683748ac5ecfdf704607441a3204d8c5516.tar.bz2 donetick-frontend-e9745683748ac5ecfdf704607441a3204d8c5516.zip |
Update Fetcher.jsx to include UpdateChoreAssignee function and ChoreCard.jsx to handle assignee change
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/Fetcher.jsx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/Fetcher.jsx b/src/utils/Fetcher.jsx index 17b6cd9..5b3bbd9 100644 --- a/src/utils/Fetcher.jsx +++ b/src/utils/Fetcher.jsx @@ -83,6 +83,15 @@ const SkipChore = id => { body: JSON.stringify({}), }) } + +const UpdateChoreAssignee = (id, assignee) => { + return Fetch(`${API_URL}/chores/${id}/assignee`, { + method: 'PUT', + headers: HEADERS(), + body: JSON.stringify({ assignee:Number(assignee) }), + }) +} + const CreateChore = chore => { return Fetch(`${API_URL}/chores/`, { method: 'POST', @@ -306,4 +315,5 @@ export { UpdateChoreHistory, UpdateThingState, UpdateUserDetails, + UpdateChoreAssignee, } |