Completed 2.15 & 2.16 (phonebook step7 & 8)

This commit is contained in:
2021-09-13 10:51:15 +07:00
parent fcfd29853e
commit 863458a762
17 changed files with 17915 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import axios from 'axios'
const baseUrl = 'http://localhost:3001/persons'
const getContact = () => {
const contact = axios.get(baseUrl)
return contact.then(response => response.data)
}
/*
const updateContact = newObject => {
return axios.post(baseUrl, newObject)
}
const update = (id, newObject) => {
return axios.put(`${baseUrl}/${id}`, newObject)
}*/
const Contact = {
getContact
}
export default Contact