From 90efb5be001393134aaef07fe11e9ad605692043 Mon Sep 17 00:00:00 2001
From: Mo Tarbin <mhed.t91@gmail.com>
Date: Sat, 20 Jul 2024 03:40:41 -0400
Subject: Support for history Modification and deletion

---
 src/utils/Fetcher.jsx | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

(limited to 'src/utils/Fetcher.jsx')

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,
 }
-- 
cgit 

