mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-09 14:30:44 -03:00
paginacion en /posts lista
This commit is contained in:
@@ -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}`
|
||||
|
||||
Reference in New Issue
Block a user