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

Test article lookup

parent b095398d
No related branches found
No related tags found
No related merge requests found
...@@ -88,6 +88,8 @@ const oda_api = setup({ ...@@ -88,6 +88,8 @@ const oda_api = setup({
var api_endpoint = process.env.VUE_APP_API_PREFIX + '/api/dict' var api_endpoint = process.env.VUE_APP_API_PREFIX + '/api/dict'
var oda_dev = 'https://oda.uib.no/opal/dev'
function compare_by_hgno(lemma_text) { function compare_by_hgno(lemma_text) {
return function(art1, art2) { return function(art1, art2) {
let lemma1 = art1.lemmas.filter(lemma => lemma.lemma == lemma_text)[0] let lemma1 = art1.lemmas.filter(lemma => lemma.lemma == lemma_text)[0]
...@@ -109,7 +111,7 @@ function navigate_to_article(self, source) { ...@@ -109,7 +111,7 @@ function navigate_to_article(self, source) {
if ((self.$route.query.nocache || '').toLowerCase() == 'true') { if ((self.$route.query.nocache || '').toLowerCase() == 'true') {
config.headers.cachebuster = Date.now() config.headers.cachebuster = Date.now()
} }
axios.get(api_endpoint + '/' + self.$route.params.lang + '/article/' + self.$route.params.id, config) axios.get(oda_dev + '/' + self.$route.params.lang + '/article/' + self.$route.params.id, config)
.then(function(response){ .then(function(response){
self.article = Object.assign(response.data, {'dictionary': self.$route.params.lang, source: source, results: self.search_results}) self.article = Object.assign(response.data, {'dictionary': self.$route.params.lang, source: source, results: self.search_results})
self.search_results = [] self.search_results = []
...@@ -200,7 +202,7 @@ export default { ...@@ -200,7 +202,7 @@ export default {
return (this.waiting_for_articles || this.waiting_for_metadata) && this.$route.name != 'root' return (this.waiting_for_articles || this.waiting_for_metadata) && this.$route.name != 'root'
}, },
api_pref: function() { api_pref: function() {
return api_endpoint + '/' + this.lang + '/article/' return oda_dev + '/' + this.lang + '/article/'
}, },
get_oda_api: function() { get_oda_api: function() {
return oda_api return oda_api
...@@ -230,7 +232,7 @@ export default { ...@@ -230,7 +232,7 @@ export default {
let self = this let self = this
Promise.all(unwrapped.map((article) => { Promise.all(unwrapped.map((article) => {
return axios.get(`${api_endpoint}/${article.dictionary}/article/${article.id}`) return axios.get(`${oda_dev}/${article.dictionary}/article/${article.id}.json`)
})) }))
.then((response) => { .then((response) => {
...@@ -339,11 +341,11 @@ export default { ...@@ -339,11 +341,11 @@ export default {
} }
// words of the month // words of the month
axios.get(api_endpoint + '/bob/article/5607').then(function(response){ axios.get(oda_dev + '/bob/article/5607.json').then(function(response){
self.monthly_bm = Object.assign(response.data, {dictionary: 'bob'}) self.monthly_bm = Object.assign(response.data, {dictionary: 'bob'})
}) })
axios.get(api_endpoint + '/nob/article/78569').then(function(response){ axios.get(oda_dev + '/nob/article/78569.json').then(function(response){
self.monthly_nn = Object.assign(response.data, {dictionary: 'nob'}) self.monthly_nn = Object.assign(response.data, {dictionary: 'nob'})
}) })
}).catch(function(_){ }).catch(function(_){
......
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