diff --git a/src/@utils/aquarius/index.ts b/src/@utils/aquarius/index.ts index 7fd1dc667..c3a7ff0f9 100644 --- a/src/@utils/aquarius/index.ts +++ b/src/@utils/aquarius/index.ts @@ -40,11 +40,7 @@ export function getFilterTerm( export function generateBaseQuery( baseQueryParams: BaseQueryParams ): SearchQuery { - const filters: unknown[] = [ - getFilterTerm('_index', 'aquarius') - // getFilterTerm('metadata.type', 'dataset'), - // getFilterTerm('services.type', 'access') - ] + const filters: unknown[] = [getFilterTerm('_index', 'aquarius')] baseQueryParams.filters && filters.push(...baseQueryParams.filters) baseQueryParams.chainIds && filters.push(getFilterTerm('chainId', baseQueryParams.chainIds)) diff --git a/src/components/Home/index.tsx b/src/components/Home/index.tsx index e6d80f2ea..af2ab4ed0 100644 --- a/src/components/Home/index.tsx +++ b/src/components/Home/index.tsx @@ -1,7 +1,7 @@ import React, { ReactElement, useEffect, useState } from 'react' import Button from '@shared/atoms/Button' import Bookmarks from './Bookmarks' -import { generateBaseQuery } from '@utils/aquarius' +import { generateBaseQuery, getFilterTerm } from '@utils/aquarius' import { useUserPreferences } from '@context/UserPreferences' import { SortTermOptions } from '../../@types/aquarius/SearchQuery' import TopSales from './TopSales' @@ -19,12 +19,18 @@ export default function HomePage(): ReactElement { const [queryMostAllocation, setQueryMostAllocation] = useState() + const filterDatasets: unknown[] = [ + getFilterTerm('metadata.type', 'dataset'), + getFilterTerm('services.type', 'access') + ] + useEffect(() => { const baseParams = { chainIds, esPaginationOptions: { size: 6 }, + filters: filterDatasets, sortOptions: { sortBy: SortTermOptions.Created } as SortOptions diff --git a/src/components/Search/index.tsx b/src/components/Search/index.tsx index 7979e3a9a..52421d11f 100644 --- a/src/components/Search/index.tsx +++ b/src/components/Search/index.tsx @@ -55,6 +55,11 @@ export default function SearchPage({ [router] ) + const parsedWithFilters = { + ...parsed, + serviceType: 'access', + accessType: 'dataset' + } const fetchAssets = useCallback( async (parsed: queryString.ParsedQuery, chainIds: number[]) => { setLoading(true) @@ -76,7 +81,7 @@ export default function SearchPage({ useEffect(() => { if (!parsed || !chainIds) return - fetchAssets(parsed, chainIds) + fetchAssets(parsedWithFilters, chainIds) }, [parsed, chainIds, newCancelToken, fetchAssets]) return (