diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-29 10:56:31 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-29 10:56:31 +0100 |
commit | 1c046bd96752feb1bbc0fb0e7b5fca94f299664a (patch) | |
tree | a2c5993f2c39846fef8e39c2496563edb1422c66 /pages/kronika | |
parent | a46cabb3ed27fc099f0eb68c4b073fea6615e822 (diff) | |
download | puszcza-1c046bd96752feb1bbc0fb0e7b5fca94f299664a.tar.gz puszcza-1c046bd96752feb1bbc0fb0e7b5fca94f299664a.zip |
Add apiUrl
Diffstat (limited to 'pages/kronika')
-rw-r--r-- | pages/kronika/_year/_month/_day/_title/index.vue | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pages/kronika/_year/_month/_day/_title/index.vue b/pages/kronika/_year/_month/_day/_title/index.vue index 485bfc4..0bd6c80 100644 --- a/pages/kronika/_year/_month/_day/_title/index.vue +++ b/pages/kronika/_year/_month/_day/_title/index.vue @@ -19,9 +19,11 @@ <script> import axios from 'axios' +import { apiUrl } from '~/api' + export default { head() { - if (this.attributes) { + if (!this.notFound) { return { meta: [ { @@ -51,9 +53,7 @@ export default { async asyncData({ params }) { const { year, month, day, title } = params const response = await axios - .get( - `https://feature-json-api--puszcza.netlify.com/api/posts/${year}/${month}/${day}/${title}.json` - ) + .get(`${apiUrl}/posts/${year}/${month}/${day}/${title}.json`) .catch((err) => ({ notFound: true })) const post = response.data |