mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-05-06 18:32:47 -03:00
add pagination in following and followers
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
import { obtenerSeguidoresPorUsuario } from '@/hooks/obtenerSeguidoresPorUsuario';
|
||||
import { obtenerUsuarioPorUsername } from '@/hooks/obtenerUsuario';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
import type { UserResponseDto, UsersResponseDto } from '../../../types';
|
||||
|
||||
export async function load({ params, fetch }) {
|
||||
export const load: PageLoad = async ({ params, fetch }) => {
|
||||
const usuario: UserResponseDto | null = await obtenerUsuarioPorUsername(params.perfil, fetch);
|
||||
if (!usuario) error(404, 'No se encontro el usuario, ' + params.perfil);
|
||||
|
||||
const seguidoresResponse: UsersResponseDto | null = await obtenerSeguidoresPorUsuario(
|
||||
usuario.id,
|
||||
1,
|
||||
100,
|
||||
fetch
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user