about summary refs log tree commit diff
path: root/components/Posts
diff options
context:
space:
mode:
Diffstat (limited to 'components/Posts')
-rw-r--r--components/Posts/PostList/PurePostList.vue2
-rw-r--r--components/Posts/PostList/index.js17
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