mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-05-04 18:22:47 -03:00
añadidas paginas de seguidos y seguidores
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { obtenerUsuarioPorUsername } from '@/hooks/obtenerUsuario';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import type { UserResponseDto, UsersResponseDto } from '../../../types';
|
||||
import { obtenerSeguidosPorUsuario } from '@/hooks/obtenerSeguidosPorUsuario';
|
||||
|
||||
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 seguidosResponse: UsersResponseDto | null = await obtenerSeguidosPorUsuario(
|
||||
usuario.id,
|
||||
100,
|
||||
fetch
|
||||
);
|
||||
|
||||
return {
|
||||
usuario,
|
||||
seguidos: seguidosResponse?.response || []
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user