Fix bug with uppercase in search query

This commit is contained in:
Christian Bundy 2019-12-12 15:36:32 -08:00
parent 122852a14c
commit 3c78a6ac6c
No known key found for this signature in database
GPG Key ID: EB541AAEF4366237
1 changed files with 5 additions and 0 deletions

View File

@ -4,6 +4,11 @@ const post = require('./models/post')
const searchView = require('./views/search')
module.exports = async function searchPage ({ query }) {
if (typeof query === 'string') {
// https://github.com/ssbc/ssb-search/issues/7
query = query.toLowerCase()
}
const messages = await post.search({ query })
return searchView({ messages, query })