Skip to content

Commit

Permalink
Rename policyID to policyIDs in Search
Browse files Browse the repository at this point in the history
  • Loading branch information
WojtekBoman committed May 13, 2024
1 parent 71204e2 commit 36edddc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ import TableListItemSkeleton from './Skeletons/TableListItemSkeleton';

type SearchProps = {
query: string;
policyID?: string;
policyIDs?: string;
};

function Search({query, policyID}: SearchProps) {
function Search({query, policyIDs}: SearchProps) {
const {isOffline} = useNetwork();
const styles = useThemeStyles();
useCustomBackHandler();

const hash = SearchUtils.getQueryHash(query, policyID);
const hash = SearchUtils.getQueryHash(query, policyIDs);
const [searchResults, searchResultsMeta] = useOnyx(`${ONYXKEYS.COLLECTION.SNAPSHOT}${hash}`);

useEffect(() => {
if (isOffline) {
return;
}

SearchActions.search(hash, query, policyID);
SearchActions.search(hash, query, policyIDs);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [hash, isOffline]);

Expand Down
2 changes: 1 addition & 1 deletion src/libs/API/parameters/Search.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type SearchParams = {
query: string;
policyID?: string;
policyIDs?: string;
hash: number;
};

Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/Search.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as API from '@libs/API';
import {READ_COMMANDS} from '@libs/API/types';

function search(hash: number, query: string, policyID?: string) {
API.read(READ_COMMANDS.SEARCH, {hash, query, policyID});
function search(hash: number, query: string, policyIDs?: string) {
API.read(READ_COMMANDS.SEARCH, {hash, query, policyIDs});
}

export {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SearchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function SearchPage({route}: SearchPageProps) {
shouldShowBackButton={false}
/>
<Search
policyID={activeWorkspaceID}
policyIDs={activeWorkspaceID}
query={query}
/>
</FullPageNotFoundView>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SearchPageBottomTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function SearchPageBottomTab() {
<SearchFilters query={query} />
{isSmallScreenWidth && (
<Search
policyID={activeWorkspaceID}
policyIDs={activeWorkspaceID}
query={query}
/>
)}
Expand Down

0 comments on commit 36edddc

Please sign in to comment.