Modificaciones
This commit is contained in:
@@ -19,6 +19,10 @@ const eslintConfig = [
|
||||
"build/**",
|
||||
"next-env.d.ts",
|
||||
],
|
||||
rules: {
|
||||
// permit using `any` in the codebase, otherwise Next's defaults treat it as an error
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
+27
-23
@@ -30,6 +30,33 @@ export default function EditarCasoEspecial() {
|
||||
|
||||
const params = useParams();
|
||||
const idCasoEspe = Number(params.idCasoEspecial);
|
||||
|
||||
// fetch local storage and user data when component mounts
|
||||
useEffect(() => {
|
||||
const fetchUser = async () => {
|
||||
await getLocalInfo();
|
||||
|
||||
if (!idCasoEspecial) return;
|
||||
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const data = await getUserCasoEspecial(idCasoEspecial);
|
||||
|
||||
setDatos(data);
|
||||
} catch (error: unknown) {
|
||||
const axiosErr = error as AxiosError<{ message: string }>;
|
||||
const mensaje = axiosErr?.response?.data?.message || 'No se pudo obtener la infromacion del caso especial.';
|
||||
Swal.fire({
|
||||
title: 'Error',
|
||||
icon: 'error',
|
||||
text: mensaje,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
fetchUser();
|
||||
}, []);
|
||||
|
||||
if (isNaN(idCasoEspe)) {
|
||||
return <p>Servicio inválido</p>;
|
||||
}
|
||||
@@ -100,29 +127,6 @@ export default function EditarCasoEspecial() {
|
||||
|
||||
const updateIsLoading = (value: boolean) => setIsLoading(value);
|
||||
|
||||
useEffect(() => {
|
||||
const fetchUser = async () => {
|
||||
await getLocalInfo();
|
||||
|
||||
if (!idCasoEspecial) return
|
||||
|
||||
try {
|
||||
setIsLoading(true);
|
||||
const data = await getUserCasoEspecial(idCasoEspecial)
|
||||
|
||||
setDatos(data);
|
||||
} catch (error) {
|
||||
const axiosErr = error as AxiosError<any>;
|
||||
const mensaje = axiosErr?.response?.data?.message || 'No se pudo obtener la infromacion del caso especial.'
|
||||
Swal.fire({
|
||||
title: 'Error',
|
||||
icon: 'error',
|
||||
text: mensaje,
|
||||
})
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<section className="container px-2 pb-5">
|
||||
<BotonRegresar />
|
||||
|
||||
@@ -20,7 +20,32 @@ export default function Cuestionario({ years, admin, updateIsLoading }: Props) {
|
||||
try {
|
||||
//updateIsLoading(true);
|
||||
//const res = await axiosInstance.get(`/cuestionario_alumno?year=${selectedCuestionario}&version=${version}`, {
|
||||
const res = await axiosInstance.get(`/cuestionario-alumno2`, {
|
||||
|
||||
// Hacer la validacion de que tipo de cuestionario quiere
|
||||
// if(selectedCuestionario === "cuestionario_alumno") {
|
||||
// var res = await axiosInstance.get(`/cuestionario-alumno2`, {
|
||||
// params: { anio: selectedYear, version },
|
||||
// responseType: "blob",
|
||||
// });
|
||||
// } else if(selectedCuestionario === "cuestionario_programa") {
|
||||
// var res = await axiosInstance.get(`/cuestionario-programa2`, {
|
||||
// params: { anio: selectedYear, version },
|
||||
// responseType: "blob",
|
||||
// });
|
||||
// } else {
|
||||
// Swal.fire({
|
||||
// title: 'Error',
|
||||
// text: 'Seleccione un cuestionario válido.',
|
||||
// icon: 'error',
|
||||
// })
|
||||
// return;
|
||||
// }
|
||||
|
||||
// antes
|
||||
|
||||
console.log("Estos son los datos que se van a enviar para descargar el cuestionario", { selectedCuestionario, version, selectedYear })
|
||||
|
||||
const res = await axiosInstance.get(`/${selectedCuestionario}`, {
|
||||
params: { anio: selectedYear, version },
|
||||
responseType: "blob",
|
||||
});
|
||||
@@ -85,8 +110,8 @@ export default function Cuestionario({ years, admin, updateIsLoading }: Props) {
|
||||
<InputGroup>
|
||||
<FormSelect onChange={(e) => setSelectedCuestionario(e.target.value)}>
|
||||
<option value="">Seleccione un cuestionario:</option>
|
||||
<option value="cuestionario_alumno">Cuestionario de Alumnos</option>
|
||||
<option value="cuestionario_programa">Cuestionario de Programas</option>
|
||||
<option value="cuestionario-alumno2">Cuestionario de Alumnos</option>
|
||||
<option value="cuestionario-programa2">Cuestionario de Programas</option>
|
||||
</FormSelect>
|
||||
</InputGroup>
|
||||
</FormGroup>
|
||||
|
||||
@@ -47,6 +47,7 @@ interface Datos {
|
||||
fechaLiberacion?: string;
|
||||
telefono?: string;
|
||||
direccion?: string;
|
||||
responsableIntermo?: string;
|
||||
/*
|
||||
cartaAceptacion?: boolean;
|
||||
cartaTermino?: boolean;
|
||||
@@ -145,7 +146,7 @@ export default function InformacionServicio({ admin, imprimirError, updateIsLoad
|
||||
</div>
|
||||
|
||||
<div className="mb-3">
|
||||
<label className="form-label fw-semibold">Programa:</label>
|
||||
<label className="form-label fw-semibold">Programa interno:</label>
|
||||
<p className="form-control">{datos.programa?.programa}</p>
|
||||
</div>
|
||||
|
||||
@@ -159,6 +160,11 @@ export default function InformacionServicio({ admin, imprimirError, updateIsLoad
|
||||
<p className="form-control">{datos.programa?.usuario?.nombre}</p>
|
||||
</div>
|
||||
|
||||
<div className="mb-3">
|
||||
<label className="form-label fw-semibold">Profesor:</label>
|
||||
<p className="form-control">{datos?.responsableIntermo || '-'}</p>
|
||||
</div>
|
||||
|
||||
<div className="mb-3">
|
||||
<label className="form-label fw-semibold">Correo:</label>
|
||||
<p className="form-control">{datos.programa?.usuario?.usuario}</p>
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user