diff --git a/FrontAdmin/src/API/Inhabilitaciones.ts b/FrontAdmin/src/API/Inhabilitaciones.ts index ec89afa..12a9eef 100644 --- a/FrontAdmin/src/API/Inhabilitaciones.ts +++ b/FrontAdmin/src/API/Inhabilitaciones.ts @@ -1,9 +1,9 @@ import Cookies from 'js-cookie'; -export const getInhabilitaciones = async () => { +export const getInhabilitaciones = async (limit: number, offset: number) => { try { const token = Cookies.get('tokennn'); - const response = await fetch('http://localhost:8000/api/alumnos/inhabilitados', { + const response = await fetch(`http://localhost:8000/api/alumnos/inhabilitados?limit=${limit}&offset=${offset}` , { method: 'GET', headers: { 'Content-Type': 'application/json', diff --git a/FrontAdmin/src/components/Pages/Estadisticas/SubPages/Inhabilitaciones/Inhabilitaciones.tsx b/FrontAdmin/src/components/Pages/Estadisticas/SubPages/Inhabilitaciones/Inhabilitaciones.tsx index da4a17e..5613f99 100644 --- a/FrontAdmin/src/components/Pages/Estadisticas/SubPages/Inhabilitaciones/Inhabilitaciones.tsx +++ b/FrontAdmin/src/components/Pages/Estadisticas/SubPages/Inhabilitaciones/Inhabilitaciones.tsx @@ -14,14 +14,14 @@ function Inhabilitados() { useEffect(() => { const fetchData = async () => { - const response = await getInhabilitaciones(); + const response = await getInhabilitaciones(limit1, offset1); setInhabilitados(response); setTotalInhabilitados(response.length); setLoading(false); }; fetchData(); - }, []); + }, [limit1, offset1]); const handleNextPage = () => { if (offset1 + limit1 < totalInhabilitados) { @@ -57,6 +57,19 @@ function Inhabilitados() { > Alumnos a Habilitar + + Alumnos a Inhabilitar + - - + {loading ? ( ) : ( + + + Inhabilitar + + + )} + + + + + + + {loading ? ( + + ) : + inhabilitados.length > 0 ? + ( - + Total: {totalInhabilitados} - + @@ -123,9 +153,9 @@ function Inhabilitados() { - + - )} + ):

No hay datos para mostrar

}