From 99e3c54b73b7b91dfd908e2e101f78d77106a655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Castellanos?= <77862762+angelcast2002@users.noreply.github.com> Date: Tue, 26 Sep 2023 19:50:09 -0600 Subject: [PATCH] correccion de errores --- .../src/pages/PrincipalStudent/PrincipalStudent.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/uniEmpleos/src/pages/PrincipalStudent/PrincipalStudent.jsx b/uniEmpleos/src/pages/PrincipalStudent/PrincipalStudent.jsx index b3b7ab01..de83804e 100644 --- a/uniEmpleos/src/pages/PrincipalStudent/PrincipalStudent.jsx +++ b/uniEmpleos/src/pages/PrincipalStudent/PrincipalStudent.jsx @@ -60,7 +60,11 @@ const PrincipalStudent = () => { useEffect(() => { if (apiPostulations.data) { - setPostulaciones(apiPostulations.data) + const postArray = [] + for (const i in apiPostulations.data.postulations) { + postArray.push(apiPostulations.data.postulations[i].id_oferta) + } + setPostulaciones(postArray) } }, [apiPostulations.data]) @@ -82,9 +86,9 @@ const PrincipalStudent = () => { const regex = new RegExp(carrera) if ( regex.test(postulation.nombre_carreras) && - carrera !== "" && - postulaciones.id_oferta && - !(postulation.id_oferta in postulaciones.id_oferta) + carrera !== "" && + postulaciones && + !(postulaciones.includes(postulation.id_oferta)) ) { return (