mirror of
https://github.com/10h30/fullstackopen.git
synced 2026-07-19 06:23:26 +09:00
Completed 2.17 (phonebook step 9)
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user