MCPcopy Create free account
hub / github.com/developmentseed/stac-react / fetchRequest

Function fetchRequest

src/hooks/useStacSearch.ts:110–119  ·  view source on GitHub ↗
(request: FetchRequest)

Source from the content-addressed store, hash-verified

108 * Fetch function for searches using TanStack Query
109 */
110 const fetchRequest = async (request: FetchRequest): Promise<SearchResponse> => {
111 if (!stacApi) throw new Error('No STAC API configured');
112
113 const response =
114 request.type === 'search'
115 ? await stacApi.search(request.payload, request.headers)
116 : await stacApi.get(request.url);
117
118 return handleStacResponse<SearchResponse>(response);
119 };
120
121 /**
122 * useQuery for search and pagination with caching

Callers 1

useStacSearchFunction · 0.85

Calls 3

handleStacResponseFunction · 0.90
searchMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected