extract into service
This commit is contained in:
parent
71de2807f4
commit
1603f29533
3 changed files with 27 additions and 16 deletions
10
parts/2/phoneBook/src/services/personService.js
Normal file
10
parts/2/phoneBook/src/services/personService.js
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import axios from "axios";
|
||||
|
||||
const getPersons = () => {
|
||||
return axios.get("http://localhost:3001/persons");
|
||||
};
|
||||
const addPerson = (personData) => {
|
||||
return axios.post("http://localhost:3001/persons", personData);
|
||||
};
|
||||
|
||||
export default { getPersons, addPerson };
|
||||
Loading…
Add table
Add a link
Reference in a new issue