Comenzando la implementación final de permisos y depuración. Se sigue...
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user