Comenzando la implementación final de permisos y depuración. Se sigue...
This commit is contained in:
@@ -4,6 +4,7 @@ import type { CreatePublicacionDto } from '../../models/dtos/Distribucion/Create
|
||||
import type { UpdatePublicacionDto } from '../../models/dtos/Distribucion/UpdatePublicacionDto';
|
||||
import type { PublicacionDiaSemanaDto } from '../../models/dtos/Distribucion/PublicacionDiaSemanaDto';
|
||||
import type { UpdatePublicacionDiasSemanaRequestDto } from '../../models/dtos/Distribucion/UpdatePublicacionDiasSemanaRequestDto';
|
||||
import type { PublicacionDropdownDto } from '../../models/dtos/Distribucion/PublicacionDropdownDto';
|
||||
|
||||
const getAllPublicaciones = async (
|
||||
nombreFilter?: string,
|
||||
@@ -51,6 +52,11 @@ const getPublicacionesPorDiaSemana = async (diaSemana: number): Promise<Publicac
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const getPublicacionesForDropdown = async (soloHabilitadas: boolean = true): Promise<PublicacionDropdownDto[]> => { // << NUEVA FUNCIÓN
|
||||
const response = await apiClient.get<PublicacionDropdownDto[]>('/publicaciones/dropdown', { params: { soloHabilitadas } });
|
||||
return response.data;
|
||||
};
|
||||
|
||||
const publicacionService = {
|
||||
getAllPublicaciones,
|
||||
getPublicacionById,
|
||||
@@ -59,7 +65,8 @@ const publicacionService = {
|
||||
deletePublicacion,
|
||||
getConfiguracionDiasPublicacion,
|
||||
updateConfiguracionDiasPublicacion,
|
||||
getPublicacionesPorDiaSemana
|
||||
getPublicacionesPorDiaSemana,
|
||||
getPublicacionesForDropdown,
|
||||
};
|
||||
|
||||
export default publicacionService;
|
||||
@@ -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