about summary refs log tree commit diff
path: root/src/handlers.rs
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2018-04-14T21·28+0200
committerVincent Ambo <tazjin@gmail.com>2018-04-14T21·28+0200
commitba33efd772575bbd51643fbf2aa176df3bced258 (patch)
treecc4cb1d6850b16f54144cdbc113ef8fa0aef7c20 /src/handlers.rs
parente0b1bc2627d65a759003842c4dc508e9f842da35 (diff)
refactor(handlers): Receive search terms via query parameters
There are several reasons for this, but one important one is that
people expect to be able to share search links.
Diffstat (limited to 'src/handlers.rs')
-rw-r--r--src/handlers.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/handlers.rs b/src/handlers.rs
index 02ff99394e..ccb01eb3c8 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -179,9 +179,9 @@ pub fn reply_thread(state: State<AppState>,
 /// This handler executes a full-text search on the forum database and
 /// displays the results to the user.
 pub fn search_forum(state: State<AppState>,
-                    query: Form<SearchPosts>) -> ConverseResponse {
-    let query_string = query.0.query.clone();
-    state.db.send(query.0)
+                    query: Query<SearchPosts>) -> ConverseResponse {
+    let query_string = query.query.clone();
+    state.db.send(query.into_inner())
         .flatten()
         .and_then(move |results| state.renderer.send(SearchResultPage {
             results,