about summary refs log tree commit diff
path: root/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'frontend')
-rw-r--r--frontend/Cargo.toml1
-rw-r--r--frontend/src/app.rs4
2 files changed, 3 insertions, 2 deletions
diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml
index 3730022..f3d1e6d 100644
--- a/frontend/Cargo.toml
+++ b/frontend/Cargo.toml
@@ -15,4 +15,5 @@ wasm-bindgen = "0.2.83"
 gloo-net = "0.2"
 wasm-bindgen-futures = "0.4"
 itertools = "0.10.5"
+urlencoding = "2.1.2"
 lib = { path = "../lib" }
\ No newline at end of file
diff --git a/frontend/src/app.rs b/frontend/src/app.rs
index 78c42dd..b84d814 100644
--- a/frontend/src/app.rs
+++ b/frontend/src/app.rs
@@ -68,7 +68,7 @@ impl Component for OSSE {
         }
 
         OSSE {
-            search_query,
+            search_query: urlencoding::decode(search_query.as_str()).to_owned().unwrap().to_string(),
             results: None,
         }
     }
@@ -80,7 +80,7 @@ impl Component for OSSE {
                 let search_query = self.search_query.clone();
                 let navigator = ctx.link().navigator().unwrap();
 
-                navigator.push(&Route::OSSESearch { query: search_query.clone() });
+                navigator.push(&Route::OSSESearch { query: urlencoding::encode(search_query.as_str()).to_string() });
 
                 ctx.link().send_future(async move {
                     let endpoint = format!("{}/search/{}", api_endpoint, search_query);