fix: arreglado paginador

This commit is contained in:
fede committed 2026-07-09 04:05:43 -03:00
1 parent aac88856ac
commit 3af069e9e8
8 files changed
+76 -43

No files matched your search

+2 -1
View File
@@ -11,5 +11,6 @@ export async function obtenerLogs(pagina: number): Promise<RespuestaPagina<LogEn
});
if (!res.ok) throw new Error(`No se pudieron cargar los logs (${res.status})`);
const data = await res.json();
return { logs: data.logs, maxPagina: data.maxLenght };
const totalPages = Math.ceil(data.maxlenght / 10);
return { logs: data.logs, maxPagina: Math.max(0, totalPages - 1), totalItems: data.maxlenght };
}