Skip to content

Commit 2415bde

Browse files
committed
add new const
1 parent 21777bb commit 2415bde

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/CONST/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6449,6 +6449,12 @@ const CONST = {
64496449
UNAPPROVED_CASH: 'unapprovedCash',
64506450
UNAPPROVED_COMPANY_CARDS: 'unapprovedCompanyCards',
64516451
},
6452+
TODO_SEARCH_KEYS: {
6453+
SUBMIT: 'submit',
6454+
APPROVE: 'approve',
6455+
PAY: 'pay',
6456+
EXPORT: 'export',
6457+
},
64526458
},
64536459

64546460
EXPENSE: {

src/libs/SearchQueryUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ function getCurrentSearchQueryJSON() {
960960
return queryJSON;
961961
}
962962

963-
function getTodoSearchQuery(action: 'submit' | 'approve' | 'pay' | 'export', userAccountID: number | undefined) {
963+
function getTodoSearchQuery(action: ValueOf<typeof CONST.SEARCH.TODO_SEARCH_KEYS>, userAccountID: number | undefined) {
964964
switch (action) {
965965
case 'submit':
966966
return buildQueryStringFromFilterFormValues({

src/libs/SearchUIUtils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function getSuggestedSearches(defaultFeedID: string | undefined, accountID: numb
268268
translationPath: 'common.submit',
269269
type: CONST.SEARCH.DATA_TYPES.EXPENSE,
270270
icon: Expensicons.Pencil,
271-
searchQuery: getTodoSearchQuery('submit', accountID),
271+
searchQuery: getTodoSearchQuery(CONST.SEARCH.TODO_SEARCH_KEYS.SUBMIT, accountID),
272272
get hash() {
273273
return buildSearchQueryJSON(this.searchQuery)?.hash ?? CONST.DEFAULT_NUMBER_ID;
274274
},
@@ -278,7 +278,7 @@ function getSuggestedSearches(defaultFeedID: string | undefined, accountID: numb
278278
translationPath: 'search.bulkActions.approve',
279279
type: CONST.SEARCH.DATA_TYPES.EXPENSE,
280280
icon: Expensicons.ThumbsUp,
281-
searchQuery: getTodoSearchQuery('approve', accountID),
281+
searchQuery: getTodoSearchQuery(CONST.SEARCH.TODO_SEARCH_KEYS.APPROVE, accountID),
282282
get hash() {
283283
return buildSearchQueryJSON(this.searchQuery)?.hash ?? CONST.DEFAULT_NUMBER_ID;
284284
},
@@ -288,7 +288,7 @@ function getSuggestedSearches(defaultFeedID: string | undefined, accountID: numb
288288
translationPath: 'search.bulkActions.pay',
289289
type: CONST.SEARCH.DATA_TYPES.EXPENSE,
290290
icon: Expensicons.MoneyBag,
291-
searchQuery: getTodoSearchQuery('pay', accountID),
291+
searchQuery: getTodoSearchQuery(CONST.SEARCH.TODO_SEARCH_KEYS.PAY, accountID),
292292
get hash() {
293293
return buildSearchQueryJSON(this.searchQuery)?.hash ?? CONST.DEFAULT_NUMBER_ID;
294294
},
@@ -298,7 +298,7 @@ function getSuggestedSearches(defaultFeedID: string | undefined, accountID: numb
298298
translationPath: 'common.export',
299299
type: CONST.SEARCH.DATA_TYPES.EXPENSE,
300300
icon: Expensicons.CheckCircle,
301-
searchQuery: getTodoSearchQuery('export', accountID),
301+
searchQuery: getTodoSearchQuery(CONST.SEARCH.TODO_SEARCH_KEYS.EXPORT, accountID),
302302
get hash() {
303303
return buildSearchQueryJSON(this.searchQuery)?.hash ?? CONST.DEFAULT_NUMBER_ID;
304304
},

0 commit comments

Comments
 (0)