añadidas paginas de seguidos y seguidores

This commit is contained in:
2026-01-08 18:35:40 -03:00
parent 0e924bfc31
commit 1bc1028ab7
6 changed files with 140 additions and 3 deletions
+20
View File
@@ -0,0 +1,20 @@
import { obtenerSeguidoresPorUsuario } from '@/hooks/obtenerSeguidoresPorUsuario';
import { obtenerUsuarioPorUsername } from '@/hooks/obtenerUsuario';
import { error } from '@sveltejs/kit';
import type { UserResponseDto, UsersResponseDto } from '../../../types';
export async function load({ 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,
100,
fetch
);
return {
usuario,
seguidores: seguidoresResponse?.response || []
};
}