Skip to content
Snippets Groups Projects
Commit 20de7c52 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

mer robust håndtering av manglende artikkelelementer, sender api-nøkkel

parent 87045c7d
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,13 @@ import '@trevoreyre/autocomplete-vue/dist/style.css' ...@@ -59,6 +59,13 @@ import '@trevoreyre/autocomplete-vue/dist/style.css'
var api_endpoint = 'https://ordbok-dev.aws.uib.no/cache/article' 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) { window.onpopstate = function (event) {
if (event.state) { if (event.state) {
app.__vue__._data.article = event.state.article app.__vue__._data.article = event.state.article
......
<template> <template>
<article v-show="article.lemmas.length"> <article v-show="article.lemmas.length">
<Header :lemmas="article.lemmas" /> <Header :lemmas="article.lemmas" />
<section v-if="article.body.pronunciation.length"> <section v-if="article.body.pronunciation && article.body.pronunciation.length">
<h3>Uttale</h3> <h3>Uttale</h3>
<ul> <ul>
<DefElement v-for="(element, index) in article.body.pronunciation" :key="index" :body='element' @article-click="article_link_click" /> <DefElement v-for="(element, index) in article.body.pronunciation" :key="index" :body='element' @article-click="article_link_click" />
</ul> </ul>
</section> </section>
<section v-if="article.body.etymology"> <section v-if="article.body.etymology && article.body.etymology.length">
<h3>Etymologi</h3> <h3>Etymologi</h3>
<ul> <ul>
<DefElement v-for="(element, index) in article.body.etymology" :key="index" :body='element' @article-click="article_link_click" /> <DefElement v-for="(element, index) in article.body.etymology" :key="index" :body='element' @article-click="article_link_click" />
......
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