Skip to content

Commit

Permalink
Merge pull request Expensify#49528 from Expensify/lucien/fix-savedsea…
Browse files Browse the repository at this point in the history
…rch-emojis

[Search v2.3] Allow emojis in saved searches
  • Loading branch information
luacmartins authored Sep 24, 2024
2 parents a7a0c53 + fcc2393 commit dc74ee3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/libs/API/parameters/SaveSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {SearchQueryString} from '@components/Search/types';

type SaveSearchParams = {
jsonQuery: SearchQueryString;
name?: string;
newName?: string;
};

export default SaveSearchParams;
6 changes: 3 additions & 3 deletions src/libs/actions/Search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ function getOnyxLoadingData(hash: number): {optimisticData: OnyxUpdate[]; finall
return {optimisticData, finallyData};
}

function saveSearch({queryJSON, name}: {queryJSON: SearchQueryJSON; name?: string}) {
const saveSearchName = name ?? queryJSON?.inputQuery ?? '';
function saveSearch({queryJSON, newName}: {queryJSON: SearchQueryJSON; newName?: string}) {
const saveSearchName = newName ?? queryJSON?.inputQuery ?? '';
const jsonQuery = JSON.stringify(queryJSON);

API.write(WRITE_COMMANDS.SAVE_SEARCH, {jsonQuery, name: saveSearchName});
API.write(WRITE_COMMANDS.SAVE_SEARCH, {jsonQuery, newName: saveSearchName});
}

function deleteSavedSearch(hash: number) {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search/SavedSearchRenamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function SavedSearchRenamePage({route}: {route: {params: {q: string; name: strin

SearchActions.saveSearch({
queryJSON,
name: newName,
newName,
});

applyFiltersAndNavigate();
Expand Down

0 comments on commit dc74ee3

Please sign in to comment.