From eab827429ad2a9b2ee6542e16622a2cd61f472e9 Mon Sep 17 00:00:00 2001 From: Henrik Askjer <henrik.askjer@uib.no> Date: Wed, 29 Sep 2021 14:17:36 +0200 Subject: [PATCH] Move stage to end of api call --- src/components/Autocomplete.vue | 2 +- src/components/DictionaryView.vue | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Autocomplete.vue b/src/components/Autocomplete.vue index 97d99d4d..cc772990 100644 --- a/src/components/Autocomplete.vue +++ b/src/components/Autocomplete.vue @@ -90,7 +90,7 @@ this.items.push({q: q, match: q, label: q+" ", time: time, search: search}) } let self = this - self.api.get('suggest?', {params: {q: q, dict: self.$parent.lang, n: 80, scope: 'w'}}) + self.api.get('suggest?', {params: {q: q, dict: self.$parent.lang, n: 80, scope: 'w', stage: self.$parent.API_STAGE}}) .then(async (response) => { if (self.$refs.autocomplete.searchInput == q & self.suggesting) { diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue index 3e044008..a66555ad 100644 --- a/src/components/DictionaryView.vue +++ b/src/components/DictionaryView.vue @@ -85,7 +85,6 @@ const dicts = {'nob': 'Nynorskorboka', const api = setup({ baseURL: SEARCH_ENDPOINT, - params: {stage: API_STAGE}, cache: { maxAge: 15 * 60 * 1000, exclude: { @@ -158,7 +157,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"}}).then((response) => { + api.get('articles?', {params: {w: query.match || query.q, dict: self.lang, scope: "w", stage: API_STAGE}}).then((response) => { let article_ids = response.data let unwrapped = [] for (const d in article_ids) { -- GitLab