From f54956998e165613a4b370cac60a14984c4207c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ole=20Volds=C3=A6ter?= <ole.voldsater@uib.no>
Date: Mon, 25 Jan 2021 16:23:42 +0100
Subject: [PATCH] fikser meta#234

---
 src/App.vue | 6 ++++--
 src/main.js | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index 507df7a..37e1394 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -188,7 +188,7 @@ export default {
       }else{
         this.waiting_for_articles = true
         this.article = {lemmas: [], body:{pronunciation: [], definitions: [], etymology: []}}
-        this.$router.push(`/search?q=${event.q}&lang=${this.lang}`)
+        this.$router.push(`/${this.lang}/search/${event.q}`)
         navigate_to_search(this, event.q)
       }
     },
@@ -219,13 +219,15 @@ export default {
     ]).then(function(_) {
       self.waiting_for_metadata = false
       if(self.$route.name == 'word') {
+        self.lang = self.$route.params.lang
         navigate_to_word(self, self.$route.params.word)
       }
       else if(self.$route.name == 'lookup'){
         navigate_to_article(self, self.$route.params.id)
       }
       else if (self.$route.name == 'search') {
-        navigate_to_search(self, self.$route.query.q)
+        self.lang = self.$route.params.lang
+        navigate_to_search(self, self.$route.params.query)
       }
       else {
         self.waiting_for_articles = false
diff --git a/src/main.js b/src/main.js
index 6459199..3c1f5c8 100644
--- a/src/main.js
+++ b/src/main.js
@@ -30,7 +30,7 @@ const router = new VueRouter({
       props: true }, // Pass route.params to props
     {
       name: 'search',
-      path: '/search',
+      path: '/:lang/search/:query',
       component: App,
       props: true}
   ]
-- 
GitLab