fullstackopen-notes/parts/2/phoneBook/src/services/personService.js
2025-05-27 16:42:59 +02:00

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 };