import type { SearchRequest } from "@/types/request.types";
import httpClient from "@/services/httpClient";
import * as urlHelper from "@/libs/url.lib"
import type { SearchResult } from "@/types/search.types";

const _url = urlHelper.withPrefix("/gw/search/search")

export async function search(query: SearchRequest): Promise<SearchResult> {
  const resp = await httpClient.post(_url(), query)
  return resp.data.data
}
