diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-28 20:02:14 +0100 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-01-28 20:02:14 +0100 |
commit | d0885eb9a0d9d6ff33a3203a693f72e9de4dc562 (patch) | |
tree | bc011f75b5fed8636891fca6f85717bcfc103a02 /components/Posts/PostList | |
parent | 474d2bd31fdb0d13e07793c31d82e4eb264731cf (diff) | |
download | puszcza-d0885eb9a0d9d6ff33a3203a693f72e9de4dc562.tar.gz puszcza-d0885eb9a0d9d6ff33a3203a693f72e9de4dc562.zip |
Fix image
Diffstat (limited to 'components/Posts/PostList')
-rw-r--r-- | components/Posts/PostList/PurePostList.vue | 2 | ||||
-rw-r--r-- | components/Posts/PostList/index.js | 17 |
2 files changed, 8 insertions, 11 deletions
diff --git a/components/Posts/PostList/PurePostList.vue b/components/Posts/PostList/PurePostList.vue index 210973e..cdbaffc 100644 --- a/components/Posts/PostList/PurePostList.vue +++ b/components/Posts/PostList/PurePostList.vue @@ -12,7 +12,7 @@ :route="post.route" :title="post.title" :description="post.description" - :image="post.image" + :image="post.meta.image" /> </div> </transition> diff --git a/components/Posts/PostList/index.js b/components/Posts/PostList/index.js index 7e0b1f4..844f562 100644 --- a/components/Posts/PostList/index.js +++ b/components/Posts/PostList/index.js @@ -4,20 +4,17 @@ import k from '~/api' import PostList from './PostList' export const getPosts = async () => { - if (process.client) { - let posts = await axios.get(`${window.location.origin}/api/posts.json`) - return parsePosts(posts.data) - } else { - return parsePosts(k.getPosts()) - } + let posts = await axios.get(`https://puszcza.netlify.com/api/posts.json`) + return parsePosts(posts.data) } export const parsePosts = (posts) => posts.map((post) => ({ - title: post.content.meta.title, - image: post.content.meta.image, - description: post.content.description, - route: post.route, + title: post.title, + image: post.image, + description: post.description, + route: post.path, + meta: post.meta, })) export default PostList |