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}`); }; const updatePerson = (personId, personData) => { return axios.put(`http://localhost:3001/persons/${personId}`, personData); }; export default { getPersons, addPerson, deletePerson, updatePerson };