From fbc65c3a25a456a1c2f82725763bec9a0fc8f9d7 Mon Sep 17 00:00:00 2001
From: Henrik Askjer <henrik.askjer@uib.no>
Date: Fri, 22 Oct 2021 15:52:48 +0200
Subject: [PATCH] update search endpoint env variable

---
 .env                              | 1 -
 .env.dev_server                   | 2 +-
 .env.local                        | 2 +-
 .env.production                   | 2 +-
 src/components/Autocomplete.vue   | 2 +-
 src/components/DictionaryView.vue | 4 +---
 6 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/.env b/.env
index e2df1ae2..e69de29b 100644
--- a/.env
+++ b/.env
@@ -1 +0,0 @@
-VUE_APP_SEARCH_ENDPOINT='https://oda.uib.no/opal/api/'
diff --git a/.env.dev_server b/.env.dev_server
index 8c9f2bf6..31573c16 100644
--- a/.env.dev_server
+++ b/.env.dev_server
@@ -1,3 +1,3 @@
 NODE_ENV=production
-VUE_APP_API_STAGE=dev
 VUE_APP_ARTICLE_ENDPOINT='https://oda.uib.no/opal/dev/'
+VUE_APP_SEARCH_ENDPOINT='https://oda.uib.no/opal/dev/api/'
diff --git a/.env.local b/.env.local
index 6750c0ed..53d6b6d7 100644
--- a/.env.local
+++ b/.env.local
@@ -1,4 +1,4 @@
-VUE_APP_API_STAGE=dev
 VUE_APP_ARTICLE_ENDPOINT='https://oda.uib.no/opal/dev/'
+VUE_APP_SEARCH_ENDPOINT='https://oda.uib.no/opal/dev/api/'
 VUE_APP_VERSION_LABEL=LOCAL
 VUE_APP_RELEASE=test
diff --git a/.env.production b/.env.production
index 49ffbcde..e67c7aae 100644
--- a/.env.production
+++ b/.env.production
@@ -1,4 +1,4 @@
 NODE_ENV=production
 VUE_APP_VERSION_LABEL=Beta
-VUE_APP_API_STAGE=prod
 VUE_APP_ARTICLE_ENDPOINT='https://oda.uib.no/opal/prod/'
+VUE_APP_SEARCH_ENDPOINT='https://oda.uib.no/opal/prod/api/'
diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue
index d67a8a3d..20dc33a5 100644
--- a/src/components/Autocomplete.vue
+++ b/src/components/Autocomplete.vue
@@ -96,7 +96,7 @@
           this.items.push({q: q, label: q, time: time, search: search})
         }
         let self = this
-        self.api.get('suggest?', {params: {q: q, dict: self.get_lang(), n: 80, scope: 'w', stage: self.$parent.stage}})
+        self.api.get('suggest?', {params: {q: q, dict: self.get_lang(), n: 80, scope: 'w'}})
             .then(async (response) => {
                         if (self.$refs.autocomplete.searchInput == q & self.suggesting) {
 
diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue
index 9441c69b..3786198e 100644
--- a/src/components/DictionaryView.vue
+++ b/src/components/DictionaryView.vue
@@ -78,7 +78,6 @@ import { setup } from 'axios-cache-adapter'
 
 const SEARCH_ENDPOINT = process.env.VUE_APP_SEARCH_ENDPOINT
 const ARTICLE_ENDPOINT= process.env.VUE_APP_ARTICLE_ENDPOINT
-const API_STAGE = process.env.VUE_APP_API_STAGE
 
 const dicts = {'nob': 'Nynorskorboka',
                'bob': 'Bokmålsordboka',
@@ -163,7 +162,7 @@ function navigate_to_query(self, word) {
   let  query = self.event ? self.event : {q: word} 
   
   // Get article IDs
-  api.get('articles?', {params: {w: query.match || query.q, dict: self.lang, scope: "w", stage: self.stage}}).then((response) => {
+  api.get('articles?', {params: {w: query.match || query.q, dict: self.lang, scope: "w"}}).then((response) => {
             let article_ids = response.data
             let unwrapped = []
             for (const d in article_ids) {
@@ -239,7 +238,6 @@ export default {
       monthly_bm: null,
       monthly_nn: null,
       event: null,
-      stage: API_STAGE
     }
   },
   computed: {
-- 
GitLab