Update Fetcher.jsx to include UpdateChoreAssignee function and ChoreCard.jsx to handle assignee change
This commit is contained in:
parent
b5f17dc7a6
commit
e974568374
4 changed files with 33 additions and 14 deletions
|
@ -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,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue