import axios from "axios"; import type { Post } from "../types/Post"; const APP_URL = 'http://localhost:8000/api'; export const getPosts = () => axios.get(APP_URL + '/posts'); export const createPost = (data: Omit) => axios.post(APP_URL + '/posts', data); export const getPost = (id: number) => axios.get(APP_URL + '/posts/' + id); export const updatePost = (id: number, data: Omit) => axios.put(APP_URL + '/posts/' + id, data); export const showPost = (id: number) => axios.get(APP_URL + '/posts/' + id); export const deletePost = (id: number) => axios.delete(APP_URL + '/posts/' + id);