hecha la pagina de busqueda

This commit is contained in:
2025-12-19 19:57:57 -03:00
parent 126cbf694c
commit ab21ff1ce8
5 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { apiBase } from '@/stores/url';
import { get } from 'svelte/store';
export async function busquedaUsuarios(username: string) {
if (!username) return null;
try {
const req = await fetch(`${get(apiBase)}/api/users/search?q=${username}`, {
method: 'GET'
});
if (req.ok) {
let data = await req.json();
return data;
}
return [];
} catch {
return null;
}
}