import api from "@/lib/api"; import type { Category } from "@/types/content"; export const CategoryService = { async getAll(): Promise { const { data } = await api.get("/categories"); return data; }, async getOne(id: string): Promise { const { data } = await api.get(`/categories/${id}`); return data; }, async create(category: Partial): Promise { const { data } = await api.post("/categories", category); return data; }, async update(id: string, category: Partial): Promise { const { data } = await api.patch(`/categories/${id}`, category); return data; }, async remove(id: string): Promise { await api.delete(`/categories/${id}`); }, };