Private
Public Access
fix: arreglado paginador
This commit is contained in:
1 parent
aac88856ac
commit
3af069e9e8
8 files changed
+76
-43
No files matched your search
@@ -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 };
|
||||
}
|
||||
Reference in new issue
Block a user