diff options
author | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-20 03:40:41 -0400 |
---|---|---|
committer | Mo Tarbin <mhed.t91@gmail.com> | 2024-07-20 03:40:41 -0400 |
commit | 90efb5be001393134aaef07fe11e9ad605692043 (patch) | |
tree | 9cbce35ea79248aaef510f93e8f731e9a0ef6468 /src/utils | |
parent | aed179d6b3aa9c294893b352a7e61f93076a2ad9 (diff) | |
download | donetick-frontend-90efb5be001393134aaef07fe11e9ad605692043.tar.gz donetick-frontend-90efb5be001393134aaef07fe11e9ad605692043.tar.bz2 donetick-frontend-90efb5be001393134aaef07fe11e9ad605692043.zip |
Support for history Modification and deletion
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/Fetcher.jsx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/utils/Fetcher.jsx b/src/utils/Fetcher.jsx index 1161543..17b6cd9 100644 --- a/src/utils/Fetcher.jsx +++ b/src/utils/Fetcher.jsx @@ -112,6 +112,20 @@ const GetChoreHistory = choreId => { headers: HEADERS(), }) } +const DeleteChoreHistory = (choreId, id) => { + return Fetch(`${API_URL}/chores/${choreId}/history/${id}`, { + method: 'DELETE', + headers: HEADERS(), + }) +} + +const UpdateChoreHistory = (choreId, id, choreHistory) => { + return Fetch(`${API_URL}/chores/${choreId}/history/${id}`, { + method: 'PUT', + headers: HEADERS(), + body: JSON.stringify(choreHistory), + }) +} const GetAllCircleMembers = () => { return Fetch(`${API_URL}/circles/members`, { @@ -264,6 +278,7 @@ export { CreateLongLiveToken, CreateThing, DeleteChore, + DeleteChoreHistory, DeleteCircleMember, DeleteLongLiveToken, DeleteThing, @@ -288,6 +303,7 @@ export { SaveThing, signUp, SkipChore, + UpdateChoreHistory, UpdateThingState, UpdateUserDetails, } |