BangSo/apps/mobile/lib/search.ts

10 lines
318 B
TypeScript
Raw Normal View History

2026-09-01 16:51:19 +00:00
import type { SearchHit } from "@rakazo/contracts";
import { rpc } from "./api";
export async function querySpaceSearch(q: string): Promise<SearchHit[]> {
const trimmed = q.trim();
if (!trimmed) return [];
const result = await rpc<{ hits: SearchHit[] }>("search/query", { q: trimmed });
return result.hits;
}