import apiClient from '../apiClient'; import type { PorcMonCanillaDto } from '../../models/dtos/Distribucion/PorcMonCanillaDto'; import type { CreatePorcMonCanillaDto } from '../../models/dtos/Distribucion/CreatePorcMonCanillaDto'; import type { UpdatePorcMonCanillaDto } from '../../models/dtos/Distribucion/UpdatePorcMonCanillaDto'; const getPorcMonCanillaPorPublicacion = async (idPublicacion: number): Promise => { const response = await apiClient.get(`/publicaciones/${idPublicacion}/porcentajesmoncanilla`); return response.data; }; const getPorcMonCanillaById = async (idPublicacion: number, idPorcMon: number): Promise => { const response = await apiClient.get(`/publicaciones/${idPublicacion}/porcentajesmoncanilla/${idPorcMon}`); return response.data; }; const createPorcMonCanilla = async (idPublicacion: number, data: CreatePorcMonCanillaDto): Promise => { const response = await apiClient.post(`/publicaciones/${idPublicacion}/porcentajesmoncanilla`, data); return response.data; }; const updatePorcMonCanilla = async (idPublicacion: number, idPorcMon: number, data: UpdatePorcMonCanillaDto): Promise => { await apiClient.put(`/publicaciones/${idPublicacion}/porcentajesmoncanilla/${idPorcMon}`, data); }; const deletePorcMonCanilla = async (idPublicacion: number, idPorcMon: number): Promise => { await apiClient.delete(`/publicaciones/${idPublicacion}/porcentajesmoncanilla/${idPorcMon}`); }; const porcMonCanillaService = { getPorcMonCanillaPorPublicacion, getPorcMonCanillaById, createPorcMonCanilla, updatePorcMonCanilla, deletePorcMonCanilla, }; export default porcMonCanillaService;