Add filters (#510)

This commit is contained in:
Ben Halpern 2018-06-27 21:25:25 -04:00 committed by GitHub
parent d67bd4c13e
commit 5842b73d6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View file

@ -75,11 +75,7 @@ export function conductModeration(
export function getChannels(query,retrievalID, props, paginationNumber, additionalFilters, successCb, failureCb) {
const client = algoliasearch(props.algoliaId, props.algoliaKey);
const index = client.initIndex(props.algoliaIndex);
<<<<<<< HEAD
let filters = {...{
=======
index.search(query,{
>>>>>>> b8d2c0033e7046bb5e13d456f89a2a6f328c209a
hitsPerPage: 30 + paginationNumber,
page: paginationNumber
}, ...additionalFilters};

View file

@ -303,6 +303,7 @@ export default class Chat extends Component {
const target = e.target;
if((target.scrollTop + target.offsetHeight + 1800) > target.scrollHeight) {
this.setState({fetchingPaginatedChannels: true})
const filters = this.state.channelTypeFilter === 'all' ? {} : {filters: 'channel_type:'+this.state.channelTypeFilter};
getChannels(
this.state.filterQuery,