diff --git a/src/app/administrador/servicio/page.tsx b/src/app/administrador/servicio/page.tsx index a7e7bfb..24b5acf 100644 --- a/src/app/administrador/servicio/page.tsx +++ b/src/app/administrador/servicio/page.tsx @@ -190,7 +190,7 @@ export default function Servicio() { const obtenerRegistro = async (adminInfo: AdminInfo, idServicioVal: number) => { try { updateIsLoading(true); - const res = await axiosInstance.get(`/servicio/admin?idServicio=${idServicioVal}`); //, adminInfo.token + const res = await axiosInstance.get(`/servicio/admin/${idServicioVal}`); //, adminInfo.token console.log('Respuesta del servicio:', res.data); setDatos(res.data); console.log('Programa obtenido:', datos.status); diff --git a/src/components/administrador/infomracion-responsable.tsx b/src/components/administrador/infomracion-responsable.tsx index 200df4b..dd50a49 100644 --- a/src/components/administrador/infomracion-responsable.tsx +++ b/src/components/administrador/infomracion-responsable.tsx @@ -43,7 +43,10 @@ export default function InformacionResponsable({ admin, imprimirError, updateIsL const obtenerResponsable = async () => { try { updateIsLoading(true); - const res = await axiosInstance.get(`/usuario/responsable?idUsuario=${idResponsable}`, { + + console.log("Este es el id del responsable", idResponsable) + + const res = await axiosInstance.get(`/usuario/responsable/${idResponsable}`, { headers: { Authorization: admin.token }, }); setResponsable(res.data); @@ -60,9 +63,7 @@ export default function InformacionResponsable({ admin, imprimirError, updateIsL // Funcion para obtener programas const obtenerProgramas = async () => { try { - const res = await axiosInstance.get(`/programa/programas_admin?idUsuario=${idResponsable}`, { - headers: { Authorization: admin.token }, - }); + const res = await axiosInstance.get(`/programa/programas_admin/${idResponsable}`,); setProgramas(res.data); } catch (err: unknown) { if (isAxiosError(err)) imprimirError(String(err.response?.data) || err.message || 'Error al obtener programas'); @@ -74,7 +75,7 @@ export default function InformacionResponsable({ admin, imprimirError, updateIsL // Cargar al montar useEffect(() => { const id = Number(localStorage.getItem('idResponsable')); - + if (!id) { router.push('/administrador/responsables'); } else { diff --git a/src/components/administrador/informacion-servicio.tsx b/src/components/administrador/informacion-servicio.tsx index ebc799c..c4bb3c7 100644 --- a/src/components/administrador/informacion-servicio.tsx +++ b/src/components/administrador/informacion-servicio.tsx @@ -29,15 +29,15 @@ interface Programa { programa?: string; clavePrograma?: string; acatlan?: boolean; - Usuario?: Usuario; + usuario?: Usuario; } interface Datos { idServicio?: number; - Programa?: Programa; - Carrera?: Carrera; - Usuario?: Usuario; - Status?: Status; + programa?: Programa; + carrera?: Carrera; + usuario?: Usuario; + status?: Status; creditos?: string; correo?: string; createdAt?: string; @@ -136,32 +136,32 @@ export default function InformacionServicio({ admin, imprimirError, updateIsLoad
{datos.Programa?.institucion || '-'}
+{datos.programa?.institucion || '-'}
{datos.Programa?.dependencia || '-'}
+{datos.programa?.dependencia || '-'}
{datos.Programa?.programa}
+{datos.programa?.programa}
{datos.Programa?.clavePrograma}
+{datos.programa?.clavePrograma}
{datos.Programa?.Usuario?.nombre}
+{datos.programa?.usuario?.nombre}
{datos.Programa?.Usuario?.usuario}
+{datos.programa?.usuario?.usuario}
{datos.Usuario?.usuario || '-'}
+{datos.usuario?.usuario || '-'}
{datos.Usuario?.nombre || '-'}
+{datos.usuario?.nombre || '-'}
{datos.Carrera?.carrera || '-'}
+{datos.carrera?.carrera || '-'}