fix: algoliasearch wrong search parameter (#2065)

This commit is contained in:
Nur Muhammad
2021-05-25 19:14:46 +08:00
committed by GitHub
parent 1930905252
commit 3ef01a9ee9

View File

@@ -114,11 +114,7 @@ export default {
querySearch(query, cb) {
if (!query) return
this.index.search({ query, hitsPerPage: 6 }, (err, res) => {
if (err) {
console.error(err)
return
}
this.index.search(query, { hitsPerPage: 6 }).then(res => {
if (res.hits.length > 0) {
this.isEmpty = false
cb(res.hits.map(hit => {
@@ -143,6 +139,9 @@ export default {
this.isEmpty = true
cb([{ isEmpty: true }])
}
}).catch(err => {
console.error(err)
return
})
},