From 737ab1668d0470194ecd3534a50ced6768f54ba1 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Tue, 12 Feb 2019 12:41:44 +0000 Subject: [PATCH] api calls implemented --- TODO.md | 3 +-- pages/about.vue | 7 +++---- pages/contact.vue | 7 +++---- store/navigation.js | 12 ------------ 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/TODO.md b/TODO.md index 3c7318b..0f3bc2c 100644 --- a/TODO.md +++ b/TODO.md @@ -2,8 +2,7 @@ * Galleries - title not distinguishable on light images * Galleries - navigation icons not obvious enough with light background thumbs * Galleries - thumbs on desktop - way to make them stand out aginst the image -* Galleries - sort thumbs by sort_order -* API +* General - sort things by sort_order * mailer * remove testing/dev mode or whatever its called from axios in nuxt.config.js diff --git a/pages/about.vue b/pages/about.vue index fa728b2..10ef9b0 100644 --- a/pages/about.vue +++ b/pages/about.vue @@ -55,10 +55,9 @@ export default { } }, - asyncData () { - return new Promise ((resolve, reject) => { - resolve({ imageUrl: "https://via.placeholder.com/1920x1080" }) - }) + async asyncData ({ $axios }) { + const { imageUrl } = await $axios.$get('/api/v1/page/about') + return { imageUrl } }, } diff --git a/pages/contact.vue b/pages/contact.vue index 5aa11a6..bb10871 100644 --- a/pages/contact.vue +++ b/pages/contact.vue @@ -161,10 +161,9 @@ export default { }, }, - asyncData () { - return new Promise ((resolve, reject) => { - resolve({ imageUrl: "https://via.placeholder.com/1920x1080" }) - }) + async asyncData ({ $axios }) { + const { imageUrl } = await $axios.$get('/api/v1/page/about') + return { imageUrl } }, } diff --git a/store/navigation.js b/store/navigation.js index 9936f15..cdae203 100644 --- a/store/navigation.js +++ b/store/navigation.js @@ -3,18 +3,6 @@ export const state = () => ({ socialNav: [], }) -// export const actions = { -// load ({ commit }) { -// return new Promise(resolve => { -// setTimeout(() => { -// commit('updateSiteNav', SITE_NAV) -// commit('updateSocialNav', SOCIAL_NAV) -// resolve() -// }, 300) -// }) -// } -// } -// export const getters = { siteNav: state => { return state.siteNav