Skip to content

Commit 40445d7

Browse files
authored
Merge pull request Expensify#83138 from annaweber830/fix-79952
fix: Report - Searching "in" auto completes syntax with type:expense incorrectly.
2 parents 911fd8a + 108b59c commit 40445d7

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/libs/SearchQueryUtils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,14 @@ function getQueryWithUpdatedValues(query: string, shouldSkipAmountConversion = f
18691869

18701870
const computeNodeValue = (left: SyntaxFilterKey, right: string | string[]) => getUpdatedFilterValue(left, right, shouldSkipAmountConversion);
18711871
const standardizedQuery = traverseAndUpdatedQuery(queryJSON, computeNodeValue);
1872+
const rawFilterList = getRawFilterListFromQuery(query);
1873+
const hasInFilter = rawFilterList?.some((filter) => !filter.isDefault && filter.key === CONST.SEARCH.SYNTAX_FILTER_KEYS.IN) ?? false;
1874+
const hasExplicitType = rawFilterList?.some((filter) => filter.key === CONST.SEARCH.SYNTAX_ROOT_KEYS.TYPE) ?? false;
1875+
1876+
if (hasInFilter && !hasExplicitType) {
1877+
standardizedQuery.type = CONST.SEARCH.DATA_TYPES.CHAT;
1878+
}
1879+
18721880
return buildSearchQueryString(standardizedQuery);
18731881
}
18741882

0 commit comments

Comments
 (0)