fix msg search
This commit is contained in:
parent
6c498649d0
commit
731e8731f5
|
@ -49,7 +49,7 @@ final class Msg(
|
|||
|
||||
def search(q: String) = Auth { _ => me =>
|
||||
q.trim.some.filter(_.size > 1).filter(lila.user.User.couldBeUsername) match {
|
||||
case None => BadRequest(jsonError("Invalid search query")).fuccess
|
||||
case None => env.msg.json.searchResult(me)(env.msg.search.empty) map { Ok(_) }
|
||||
case Some(q) => env.msg.search(me, q) flatMap env.msg.json.searchResult(me) map { Ok(_) }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ final class MsgSearch(
|
|||
)
|
||||
}
|
||||
|
||||
val empty = MsgSearch.Result(Nil, Nil, Nil)
|
||||
|
||||
private def searchThreads(me: User, q: String): Fu[List[MsgThread]] =
|
||||
colls.thread.ext
|
||||
.find(
|
||||
|
|
Loading…
Reference in a new issue