Comenzando la implementación final de permisos y depuración. Se sigue...

This commit is contained in:
2025-06-03 18:42:56 -03:00
parent 062cc05fd0
commit 8fb94f8cef
46 changed files with 711 additions and 493 deletions

View File

@@ -2,6 +2,7 @@ import apiClient from '../apiClient';
import type { PlantaDto } from '../../models/dtos/Impresion/PlantaDto';
import type { CreatePlantaDto } from '../../models/dtos/Impresion/CreatePlantaDto';
import type { UpdatePlantaDto } from '../../models/dtos/Impresion/UpdatePlantaDto';
import type { PlantaDropdownDto } from '../../models/dtos/Impresion/PlantaDropdownDto';
const getAllPlantas = async (nombreFilter?: string, detalleFilter?: string): Promise<PlantaDto[]> => {
const params: Record<string, string> = {};
@@ -35,12 +36,18 @@ const deletePlanta = async (id: number): Promise<void> => {
await apiClient.delete(`/plantas/${id}`);
};
const getPlantasForDropdown = async (): Promise<PlantaDropdownDto[]> => { // << NUEVA FUNCIÓN
const response = await apiClient.get<PlantaDropdownDto[]>('/plantas/dropdown');
return response.data;
};
const plantaService = {
getAllPlantas,
getPlantaById,
createPlanta,
updatePlanta,
deletePlanta,
getPlantasForDropdown,
};
export default plantaService;