about summary refs log tree commit diff
path: root/components
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-25 19:41:39 +0100
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-01-25 19:41:39 +0100
commit1aa3a88b21539aa06572d86324673baeddfbe46f (patch)
tree72baffcf2b6777e50974ac7dad71c5c09a19403b /components
parent18b44a3aebc56d32060e1d879a8f096eafbf262f (diff)
downloadpuszcza-1aa3a88b21539aa06572d86324673baeddfbe46f.tar.gz
puszcza-1aa3a88b21539aa06572d86324673baeddfbe46f.zip
Add image from meta
Diffstat (limited to 'components')
-rw-r--r--components/Posts/PostList/index.js7
-rw-r--r--components/Posts/PostList/parentMixin.js4
2 files changed, 6 insertions, 5 deletions
diff --git a/components/Posts/PostList/index.js b/components/Posts/PostList/index.js
index 11d44ff..7e0b1f4 100644
--- a/components/Posts/PostList/index.js
+++ b/components/Posts/PostList/index.js
@@ -12,11 +12,12 @@ export const getPosts = async () => {
   }
 }
 
-export const parsePosts = posts =>
-  posts.map(post => ({
+export const parsePosts = (posts) =>
+  posts.map((post) => ({
     title: post.content.meta.title,
+    image: post.content.meta.image,
     description: post.content.description,
-    route: post.route
+    route: post.route,
   }))
 
 export default PostList
diff --git a/components/Posts/PostList/parentMixin.js b/components/Posts/PostList/parentMixin.js
index e5b06ed..801d51c 100644
--- a/components/Posts/PostList/parentMixin.js
+++ b/components/Posts/PostList/parentMixin.js
@@ -3,7 +3,7 @@ import { getPosts } from './index'
 export default {
   async asyncData() {
     return {
-      posts: await getPosts()
+      posts: await getPosts(),
     }
-  }
+  },
 }