Fixes search queries on collection modal.
This commit is contained in:
parent
489611152d
commit
a8610d96c1
|
@ -69,10 +69,18 @@ export default class CollectionModal extends React.Component {
|
|||
paged: this.state.collectionPage
|
||||
}
|
||||
|
||||
if (this.props.filterOptionsBy && Object.keys(this.props.filterOptionsBy).length !== 0)
|
||||
query = {...query, meta_query: this.props.filterOptionsBy}
|
||||
|
||||
if (this.props.filterOptionsBy && Object.keys(this.props.filterOptionsBy).length !== 0) {
|
||||
let metaqueries = [];
|
||||
|
||||
for (let metaquery of Object.keys(this.props.filterOptionsBy)) {
|
||||
metaqueries.push({
|
||||
key: metaquery,
|
||||
value: this.props.filterOptionsBy[metaquery]
|
||||
})
|
||||
}
|
||||
query = {...query, metaquery: metaqueries}
|
||||
}
|
||||
|
||||
let endpoint = '/collections/?' + qs.stringify(query);
|
||||
|
||||
if (this.state.collectionOrderBy == 'date')
|
||||
|
@ -146,14 +154,12 @@ export default class CollectionModal extends React.Component {
|
|||
for (let metaquery of Object.keys(this.props.filterOptionsBy)) {
|
||||
metaqueries.push({
|
||||
key: metaquery,
|
||||
value: this.props.filterOptionsBy[key]
|
||||
value: this.props.filterOptionsBy[metaquery]
|
||||
})
|
||||
}
|
||||
|
||||
query = {...query, metaquery: metaqueries}
|
||||
}
|
||||
|
||||
|
||||
let endpoint = '/collections/?' + qs.stringify(query);
|
||||
|
||||
if (name != undefined && name != '')
|
||||
|
|
Loading…
Reference in New Issue