1export const fetchSearchResults = async (query: string) => {
2 const url = urlBuilder(routes.searchURL, {
3 uid,
4 query,
5 preview: "true",
6 device: "desktop",
7 "session-id": sessionId,
8 });
9 const response = await fetch(url);
10 const data = (await response.json()) as SearchResultsResponse;
11 return data.results;
12};
13
14export const fetchSummary = async (query: string) => {
15 const url = urlBuilder(routes.summaryURL, { uid, query });
16 const response = await fetch(url);
17 const data = await response.json();
18 return data as SummaryResponse;
19};