Update Fetcher.jsx to include UpdateChoreAssignee function and ChoreCard.jsx to handle assignee change

This commit is contained in:
Mo Tarbin 2024-08-10 02:08:49 -04:00
parent b5f17dc7a6
commit e974568374
4 changed files with 33 additions and 14 deletions

View file

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