mirror of https://github.com/buster-so/buster.git
45 seconds
This commit is contained in:
parent
4e5ac6f752
commit
56908dc77b
|
@ -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 = {
|
||||||
|
|
|
@ -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'],
|
||||||
|
|
|
@ -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(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue