45 seconds

This commit is contained in:
Nate Kelley 2025-04-09 14:48:20 -06:00
parent 4e5ac6f752
commit 56908dc77b
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import { search } from '../buster_rest/search';
export const getSearchResult = (params: Parameters<typeof search>[0]) => export const getSearchResult = (params: Parameters<typeof search>[0]) =>
queryOptions<BusterSearchResult[]>({ queryOptions<BusterSearchResult[]>({
queryKey: ['search', 'results', params] as const, queryKey: ['search', 'results', params] as const,
staleTime: 1000 * 30 // 30 seconds, staleTime: 1000 * 45 // 45 seconds,
}); });
export const searchQueryKeys = { export const searchQueryKeys = {

View File

@ -20,7 +20,7 @@ export const AddToCollectionModal: React.FC<{
const { mutateAsync: addAndRemoveAssetsFromCollection } = useAddAndRemoveAssetsFromCollection(); const { mutateAsync: addAndRemoveAssetsFromCollection } = useAddAndRemoveAssetsFromCollection();
const [searchTerm, setSearchTerm] = useState(''); const [searchTerm, setSearchTerm] = useState('');
const debouncedSearchTerm = useDebounce(searchTerm, { wait: 150 }); const debouncedSearchTerm = useDebounce(searchTerm, { wait: 100 });
const { data: searchResults } = useSearch({ const { data: searchResults } = useSearch({
query: debouncedSearchTerm, query: debouncedSearchTerm,
asset_types: ['metric', 'dashboard'], asset_types: ['metric', 'dashboard'],

View File

@ -16,7 +16,7 @@ export const AddToDashboardModal: React.FC<{
const [searchTerm, setSearchTerm] = useState(''); const [searchTerm, setSearchTerm] = useState('');
const [selectedMetrics, setSelectedMetrics] = useState<string[]>([]); const [selectedMetrics, setSelectedMetrics] = useState<string[]>([]);
const debouncedSearchTerm = useDebounce(searchTerm, { wait: 150 }); const debouncedSearchTerm = useDebounce(searchTerm, { wait: 100 });
const { data: searchResults } = useSearch( const { data: searchResults } = useSearch(
{ {