(newPost)
| 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); |
| 9 | export const deletePost = (id) => axios.delete(`${url}/${id}`); |