primer mock de como funcionaria la interfaz de seguoidos y seguidores.

tambien añadi el limite de pagina
This commit is contained in:
2025-12-03 15:02:46 -03:00
parent 9f0670907b
commit 6ac942fde0
4 changed files with 26 additions and 10 deletions

View File

@@ -3,9 +3,9 @@ import type { UserResponseDto } from "../../types";
import { get } from "svelte/store";
import { apiBase } from "@/stores/url";
export async function obtenerSeguidoresPorUsuario(Id: string): Promise<UserResponseDto[] | null> {
export async function obtenerSeguidoresPorUsuario(id: string, limit:number = 20): Promise<UserResponseDto[] | null> {
try {
const response = await fetch(`${get(apiBase)}/api/users/${Id}/followers`, {
const response = await fetch(`${get(apiBase)}/api/users/${id}/followers?limit=${limit}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',

View File

@@ -3,9 +3,9 @@ import type { UserResponseDto } from "../../types";
import { apiBase } from "@/stores/url";
import { get } from "svelte/store";
export async function obtenerSeguidosPorUsuario(id: string): Promise<UserResponseDto[] | null> {
export async function obtenerSeguidosPorUsuario(id: string, limit:number = 20): Promise<UserResponseDto[] | null> {
try {
const response = await fetch(`${get(apiBase)}/api/users/${id}/following`, {
const response = await fetch(`${get(apiBase)}/api/users/${id}/following?limit=${limit}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',