13 lines
381 B
JavaScript
13 lines
381 B
JavaScript
import axios from "axios";
|
|
|
|
const getPersons = () => {
|
|
return axios.get("http://localhost:3001/persons");
|
|
};
|
|
const addPerson = (personData) => {
|
|
return axios.post("http://localhost:3001/persons", personData);
|
|
};
|
|
const deletePerson = (personId) => {
|
|
return axios.delete(`http://localhost:3001/persons/${personId}`);
|
|
};
|
|
|
|
export default { getPersons, addPerson, deletePerson };
|