mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-05-06 18:32:47 -03:00
estaba en server por lo que daba un problema con el render del search
cuando volves
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { obtenerUsuarioPorUsername } from '@/hooks/obtenerUsuario.js';
|
||||
import type { User, UserResponseDto } from '../../types.js';
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { obtenerSeguidosPorUsuario } from '@/hooks/obtenerSeguidosPorUsuario.js';
|
||||
import { obtenerSeguidoresPorUsuario } from '@/hooks/obtenerSeguidoresPorUsuario.js';
|
||||
|
||||
export async function load({ params }) {
|
||||
const usuario: UserResponseDto | null = await obtenerUsuarioPorUsername(params.perfil);
|
||||
if(!usuario) error(404, 'No se encontro el usuario, ' + params.perfil);
|
||||
|
||||
const seguidos = await obtenerSeguidosPorUsuario(usuario.id, 3);
|
||||
const seguidores = await obtenerSeguidoresPorUsuario(usuario.id, 3);
|
||||
|
||||
return { ...usuario, seguidos, seguidores };
|
||||
}
|
||||
Reference in New Issue
Block a user