Skip to content
Snippets Groups Projects
Commit c09321f1 authored by Henrik Askjer's avatar Henrik Askjer
Browse files

Rename variables and remove obsolete config

parent 9b508950
No related branches found
No related tags found
No related merge requests found
......@@ -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: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment