diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 7d8dbb2de6a1..27e87017bfee 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -36,7 +36,7 @@ function Search({query, policyIDs}: SearchProps) { return; } - SearchActions.search(hash, query, policyIDs); + SearchActions.search(hash, query, 0, policyIDs); // eslint-disable-next-line react-hooks/exhaustive-deps }, [hash, isOffline]); @@ -65,7 +65,7 @@ function Search({query, policyIDs}: SearchProps) { return; } const currentOffset = searchResults?.search?.offset ?? 0; - SearchActions.search(query, currentOffset + CONST.SEARCH_RESULTS_PAGE_SIZE); + SearchActions.search(hash, query, currentOffset + CONST.SEARCH_RESULTS_PAGE_SIZE); }; const type = SearchUtils.getSearchType(searchResults?.search); diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index bd26a1829400..fae9a427f4fa 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -4,7 +4,7 @@ import * as API from '@libs/API'; import {READ_COMMANDS} from '@libs/API/types'; import ONYXKEYS from '@src/ONYXKEYS'; -function search(hash: number, query: string, offset = 0, policyIDs?: string, ) { +function search(hash: number, query: string, offset = 0, policyIDs?: string) { const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE,