paginacion en /posts lista

This commit is contained in:
2026-01-27 18:57:04 -03:00
parent ceec19fb91
commit b5ba2437b4
2 changed files with 32 additions and 4 deletions

View File

@@ -6,12 +6,13 @@ import type { Post } from '../../types';
export async function obtenerRespuestasPorId(
id: string,
fetch2?: Function,
depends?: Function
depends?: Function,
page: number = 1
): Promise<string | Post[] | null> {
if (depends) depends('post:respuestas');
const fetchFn = fetch2 ? fetch2 : fetch;
try {
const req = await fetchFn(`${get(apiBase)}/api/posts/${id}/replies`, {
const req = await fetchFn(`${get(apiBase)}/api/posts/${id}/replies?page=${page}`, {
method: 'GET',
headers: {
Authorization: `Bearer ${get(sesionStore)?.accessToken}`