Skip to content

Commit 2e947b7

Browse files
committed
OpenConceptLab/ocl_issues#2211 | fixing default filters
1 parent e2085ab commit 2e947b7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/search/Search.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { withTranslation } from 'react-i18next';
55
import alertifyjs from 'alertifyjs';
66
import {
77
get, set, cloneDeep, merge, forEach, includes, keys, pickBy, size, isEmpty, has, find, isEqual,
8-
map, omit, isString, values, omitBy, isNumber, filter
8+
map, omit, isString, values, omitBy, isNumber, filter, isBoolean
99
} from 'lodash';
1010
import { Share as ShareIcon, AccountTreeOutlined as HierarchyIcon } from '@mui/icons-material'
1111
import { CircularProgress, Chip, Tooltip } from '@mui/material';
@@ -156,12 +156,16 @@ class Search extends React.Component {
156156
const applied = {}
157157
forEach(filters, (value, field) => {
158158
applied[field] = {}
159-
forEach(value.split(','), val => applied[field][val] = true)
159+
if(isBoolean(value)) {
160+
applied[field][value.toString()] = true
161+
} else
162+
forEach(value.split(','), val => applied[field][val] = true)
160163
})
161164
return applied
162165
}
163166

164167

168+
165169
setQueryParamsInState() {
166170
const queryParams = new URLSearchParams(get(this.props, 'location.search'))
167171
let userFilters = this.props.userFilters || {};

0 commit comments

Comments
 (0)