import axios from "@/config/axios"; import type { CreateCatalogParamsType, UpdateCatalogParamsType, } from "../types/Types"; import type { CatalogByIdResponseType, CatalogResponseType, } from "@/pages/catalogue/types/Types"; export const createCatalog = async (params: CreateCatalogParamsType) => { const { data } = await axios.post("/catalogue", params); return data; }; export const getCatalogs = async () => { const { data } = await axios.get("/catalogue"); return data; }; export const getCatalogById = async (id: string) => { const { data } = await axios.get(`/catalogue/${id}`); return data; }; export const updateCatalog = async (params: UpdateCatalogParamsType) => { const { data } = await axios.patch(`/catalogue/${params.id}`, { content: params.content, }); return data; };