From fcc2393f0addcd0b49ed037ad958654dad312495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucien=20Akchot=C3=A9?= Date: Fri, 20 Sep 2024 13:47:58 +0200 Subject: [PATCH] allow emojis in saved search --- src/libs/API/parameters/SaveSearch.ts | 2 +- src/libs/actions/Search.ts | 6 +++--- src/pages/Search/SavedSearchRenamePage.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/API/parameters/SaveSearch.ts b/src/libs/API/parameters/SaveSearch.ts index e0ad38dd8363..9dd3416320c7 100644 --- a/src/libs/API/parameters/SaveSearch.ts +++ b/src/libs/API/parameters/SaveSearch.ts @@ -2,7 +2,7 @@ import type {SearchQueryString} from '@components/Search/types'; type SaveSearchParams = { jsonQuery: SearchQueryString; - name?: string; + newName?: string; }; export default SaveSearchParams; diff --git a/src/libs/actions/Search.ts b/src/libs/actions/Search.ts index a4f0e59ef976..43f6b975a451 100644 --- a/src/libs/actions/Search.ts +++ b/src/libs/actions/Search.ts @@ -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) { diff --git a/src/pages/Search/SavedSearchRenamePage.tsx b/src/pages/Search/SavedSearchRenamePage.tsx index 0460ecae5317..239ceb7af160 100644 --- a/src/pages/Search/SavedSearchRenamePage.tsx +++ b/src/pages/Search/SavedSearchRenamePage.tsx @@ -35,7 +35,7 @@ function SavedSearchRenamePage({route}: {route: {params: {q: string; name: strin SearchActions.saveSearch({ queryJSON, - name: newName, + newName, }); applyFiltersAndNavigate();