diff --git a/src/App.vue b/src/App.vue index 55dd0fa65dc24858275d4deb04463afcbe2b28f5..480bc89044d6a03b2697496a72e0eb0699c64b2a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -59,6 +59,13 @@ import '@trevoreyre/autocomplete-vue/dist/style.css' var api_endpoint = 'https://ordbok-dev.aws.uib.no/cache/article' +axios.interceptors.request.use(function (config) { + config.headers["x-api-key"] = "ZkYiyRVXxH86ijsvhx3cH4SY5Iik2ijI3BKVJGMm" + return config; + }, function (error) { + return Promise.reject(error); + }); + window.onpopstate = function (event) { if (event.state) { app.__vue__._data.article = event.state.article diff --git a/src/components/Article.vue b/src/components/Article.vue index f04d668063b13b687f3298da6608a52abab21d98..962b7e724276469854c1fb2218bb23778cd17ae0 100644 --- a/src/components/Article.vue +++ b/src/components/Article.vue @@ -1,13 +1,13 @@ <template> <article v-show="article.lemmas.length"> <Header :lemmas="article.lemmas" /> - <section v-if="article.body.pronunciation.length"> + <section v-if="article.body.pronunciation && article.body.pronunciation.length"> <h3>Uttale</h3> <ul> <DefElement v-for="(element, index) in article.body.pronunciation" :key="index" :body='element' @article-click="article_link_click" /> </ul> </section> - <section v-if="article.body.etymology"> + <section v-if="article.body.etymology && article.body.etymology.length"> <h3>Etymologi</h3> <ul> <DefElement v-for="(element, index) in article.body.etymology" :key="index" :body='element' @article-click="article_link_click" />