import { http } from '@/lib' import type { PageParams, Post, PostFormOutput } from '@/schemas' export const getPosts = (params: PageParams) => { return http.get>('/post', { params }) } export const createPost = (data: PostFormOutput) => { return http.post<{ post_id: number }>('/post', data) } export const updatePost = (id: number, data: PostFormOutput) => { return http.patch(`/post/${id}`, data) } export const getPost = (id: number) => { return http.get(`/post/${id}`) } export const deletePost = (id: number) => { return http.delete(`/post/${id}`) }