()
| 3 | const url = 'http://localhost:5000/posts'; |
| 4 | |
| 5 | export const fetchPosts = () => axios.get(url); |
| 6 | export const createPost = (newPost) => axios.post(url, newPost); |
| 7 | export const likePost = (id) => axios.patch(`${url}/${id}/likePost`); |
| 8 | export const updatePost = (id, updatedPost) => axios.patch(`${url}/${id}`, updatedPost); |