feat+refactor: Funcionalidad de busqueda de hashtags

This commit is contained in:
2026-01-01 21:38:32 -03:00
parent 7de6125eb8
commit c815f0b291
2 changed files with 62 additions and 30 deletions

View File

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