From c09321f1b973e56a872f62e6fccf29fb2875e966 Mon Sep 17 00:00:00 2001 From: Henrik Askjer <henrik.askjer@uib.no> Date: Wed, 29 Sep 2021 13:20:08 +0200 Subject: [PATCH] Rename variables and remove obsolete config --- src/components/DictionaryView.vue | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/components/DictionaryView.vue b/src/components/DictionaryView.vue index f80e2842..b119b8e9 100644 --- a/src/components/DictionaryView.vue +++ b/src/components/DictionaryView.vue @@ -29,7 +29,7 @@ </v-radio> </v-radio-group> </div> - <Autocomplete @submit="select_result" :api="get_oda_api"> + <Autocomplete @submit="select_result" :api="get_search_endpoint"> </Autocomplete> </div> <div id="spinner" v-if="waiting"> @@ -87,7 +87,7 @@ const dicts = {'nob': 'Nynorskorboka', 'bob': 'Bokmålsordboka', 'bob,nob': 'ordbøkene'} -const oda_api = setup({ +const api = setup({ baseURL: SEARCH_ENDPOINT, params: {stage: API_STAGE}, cache: { @@ -104,12 +104,11 @@ const oda_api = setup({ function navigate_to_article(self, source) { - let config = {headers: {}} /* if ((self.$route.query.nocache || '').toLowerCase() == 'true') { config.headers.cachebuster = Date.now() }*/ - axios.get(ARTICLE_ENDPOINT + self.$route.params.lang + '/article/' + self.$route.params.id + ".json", config) + axios.get(ARTICLE_ENDPOINT + self.$route.params.lang + '/article/' + self.$route.params.id + ".json") .then(function(response){ self.article = Object.assign(response.data, {'dictionary': self.$route.params.lang, results: self.search_results}) self.search_results = [] @@ -163,7 +162,7 @@ function navigate_to_query(self, word) { let query = self.event ? self.event : {q: word} // Get article IDs - oda_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"}}).then((response) => { let article_ids = response.data let unwrapped = [] for (const d in article_ids) { @@ -237,11 +236,8 @@ export default { waiting: function() { return (this.waiting_for_articles || this.waiting_for_metadata) && this.$route.name != 'root' }, - api_pref: function() { - return ARTICLE_ENDPOINT + this.lang + '/article/' - }, - get_oda_api: function() { - return oda_api + get_search_endpoint: function() { + return api }, }, components: { -- GitLab