Skip to content

Commit

Permalink
push empty values to categories and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Oct 17, 2024
1 parent 1b3590e commit bc2514d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libs/SearchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,14 +704,16 @@ function buildFilterFormValuesFromQuery(
.filter((item) => !!item)
.map((tagList) => getTagNamesFromTagsLists(tagList ?? {}))
.flat();
tags.push(CONST.SEARCH.EMPTY_VALUE);
filtersForm[filterKey] = filters[filterKey]?.map((tag) => tag.value.toString()).filter((name) => tags.includes(name));
}
if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY) {
const categories = policyID
? Object.values(policyCategories?.[`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`] ?? {}).map((category) => category.name)
: Object.values(policyCategories ?? {})
.map((xd) => Object.values(xd ?? {}).map((category) => category.name))
.map((item) => Object.values(item ?? {}).map((category) => category.name))
.flat();
categories.push(CONST.SEARCH.EMPTY_VALUE);
filtersForm[filterKey] = filters[filterKey]?.map((category) => category.value.toString()).filter((name) => categories.includes(name));
}
if (filterKey === CONST.SEARCH.SYNTAX_FILTER_KEYS.KEYWORD) {
Expand Down

0 comments on commit bc2514d

Please sign in to comment.