fix: no se usaba el fetch del framework

This commit is contained in:
2025-12-29 20:46:35 -03:00
parent bce2c6b949
commit e21d06e898
2 changed files with 5 additions and 4 deletions

View File

@@ -2,10 +2,11 @@ import { apiBase } from '@/stores/url';
import { sesionStore } from '@/stores/usuario';
import { get } from 'svelte/store';
export async function obtenerCantidadDeUsosdeHtag(htag: string) {
export async function obtenerCantidadDeUsosdeHtag(htag: string, fetch2?: Function) {
if (!htag) return null;
const fetchFn = fetch2 || fetch;
try {
const req = await fetch(`${get(apiBase)}/api/posts/hashtag/${htag}`, {
const req = await fetchFn(`${get(apiBase)}/api/posts/hashtag/${htag}`, {
method: 'GET',
headers: {
Authorization: `Bearer ${get(sesionStore)?.accessToken}`