diff --git a/src/routes/search/[user]/+page.svelte b/src/routes/search/[user]/+page.svelte index d06cf86..a79e307 100644 --- a/src/routes/search/[user]/+page.svelte +++ b/src/routes/search/[user]/+page.svelte @@ -1,16 +1,43 @@
+

Usuarios

+ {#each data.usuarios as usu}
{/each} + +
+

Hastags

+
+ +
+ {#each data.htags as htag} + +
+ #{htag} + +
+
+ {/each} +
diff --git a/src/routes/search/[user]/+page.ts b/src/routes/search/[user]/+page.ts index 9f4fd74..5dd1acc 100644 --- a/src/routes/search/[user]/+page.ts +++ b/src/routes/search/[user]/+page.ts @@ -1,9 +1,15 @@ import { busquedaUsuarios } from '@/hooks/busquedaUsuarios'; import { error } from '@sveltejs/kit'; import type { UserResponseDto } from '../../../types'; +import { busquedaHashtags } from '@/hooks/busquedaHashtags.js'; export async function load({ params }) { - let usuarios: UserResponseDto[] = await busquedaUsuarios(params.user); + let req1 = busquedaUsuarios(params.user); + //usa el mismo param + let req2 = busquedaHashtags(params.user); + + let [usuarios, htags] = await Promise.all([req1, req2]); + if (usuarios == null) { return error(500, 'No se pudo alcanzar el servidor.'); } @@ -11,5 +17,5 @@ export async function load({ params }) { if (usuarios.length == 0) { return error(404, 'No se encontraron usuarios que coinsidan con la busqueda.'); } - return { usuarios }; + return { usuarios, htags }; }