Skip to content

Commit

Permalink
Merge pull request #982 from glific/bug/searches
Browse files Browse the repository at this point in the history
Collections issue with search
  • Loading branch information
DigneshGujarathi authored Feb 3, 2021
2 parents b985e6a + d425703 commit d88af43
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/containers/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Search: React.SFC<SearchProps> = ({ match, type, search, ...props }
const [label, setLabel] = useState('');
const [term, setTerm] = useState('');
const [includeTags, setIncludeTags] = useState([]);
const [includeCollections, setIncludeCollections] = useState([]);
const [includeGroups, setIncludeGroups] = useState([]);
const [includeUsers, setIncludeUsers] = useState([]);
const [dateFrom, setdateFrom] = useState(null);
const [dateTo, setdateTo] = useState(null);
Expand All @@ -65,7 +65,7 @@ export const Search: React.SFC<SearchProps> = ({ match, type, search, ...props }
label,
term,
includeTags,
includeCollections,
includeGroups,
includeUsers,
dateFrom,
dateTo,
Expand All @@ -91,9 +91,9 @@ export const Search: React.SFC<SearchProps> = ({ match, type, search, ...props }
if (Object.prototype.hasOwnProperty.call(filters.filter, 'includeTags'))
setIncludeTags(getObject(dataT.tags, filters.filter.includeTags));
break;
case 'includeCollections':
if (Object.prototype.hasOwnProperty.call(filters.filter, 'includeCollections'))
setIncludeCollections(getObject(data.groups, filters.filter.includeGroups));
case 'includeGroups':
if (Object.prototype.hasOwnProperty.call(filters.filter, 'includeGroups'))
setIncludeGroups(getObject(data.groups, filters.filter.includeGroups));
break;
case 'includeUsers':
if (Object.prototype.hasOwnProperty.call(filters.filter, 'includeUsers'))
Expand Down Expand Up @@ -132,7 +132,7 @@ export const Search: React.SFC<SearchProps> = ({ match, type, search, ...props }
includeTags: props.searchParam.includeTags
? props.searchParam.includeTags.map((option: any) => option.id)
: [],
includeCollections: props.searchParam.includeGroups
includeGroups: props.searchParam.includeGroups
? props.searchParam.includeGroups.map((option: any) => option.id)
: [],
includeUsers: props.searchParam.includeUsers
Expand Down Expand Up @@ -234,7 +234,7 @@ export const Search: React.SFC<SearchProps> = ({ match, type, search, ...props }
},
{
component: AutoComplete,
name: 'includeCollections',
name: 'includeGroups',
placeholder: 'Includes collections',
label: 'Includes collections',
options: data.groups,
Expand Down

0 comments on commit d88af43

Please sign in to comment.