Completed 2.17 (phonebook step 9)

This commit is contained in:
2021-09-14 09:49:46 +07:00
parent c0bbf2502b
commit 81be82c0e8
4 changed files with 23 additions and 19 deletions
+5 -1
View File
@@ -14,6 +14,10 @@ const updateContact = newPerson => {
return contact.then(response => response.data)
}
const deleteContact = id => {
const contact = axios.delete(`${baseUrl}/${id}`)
return contact.then(response => response.data)
}
/*
const update = (id, newObject) => {
@@ -21,7 +25,7 @@ const updateContact = newPerson => {
}*/
const Contact = {
getContact, updateContact
getContact, updateContact, deleteContact
}
export default Contact