Files
leocrm/frontend/src/api/searchHooks.ts
T

14 lines
372 B
TypeScript
Raw Normal View History

import { useQuery } from '@tanstack/react-query';
import type { FacetsResponse } from './search';
export function useSearchFacets() {
return useQuery({
queryKey: ['searchFacets'],
queryFn: async (): Promise<FacetsResponse> => {
const { fetchFacets } = await import('@/api/search');
return fetchFacets();
},
staleTime: 5 * 60 * 1000,
});
}