about summary refs log tree commit diff
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
parent18b44a3aebc56d32060e1d879a8f096eafbf262f (diff)
downloadpuszcza-1aa3a88b21539aa06572d86324673baeddfbe46f.tar.gz
puszcza-1aa3a88b21539aa06572d86324673baeddfbe46f.zip
Add image from meta
-rw-r--r--components/Posts/PostList/index.js7
-rw-r--r--components/Posts/PostList/parentMixin.js4
-rw-r--r--package-lock.json12
3 files changed, 12 insertions, 11 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(),
     }
-  }
+  },
 }
diff --git a/package-lock.json b/package-lock.json
index a1270a4..d079c1b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5022,9 +5022,9 @@
       }
     },
     "@types/node": {
-      "version": "12.12.14",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz",
-      "integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA=="
+      "version": "13.5.0",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-13.5.0.tgz",
+      "integrity": "sha512-Onhn+z72D2O2Pb2ql2xukJ55rglumsVo1H6Fmyi8mlU9SvKdBk/pUSUAiBY/d9bAOF7VVWajX3sths/+g6ZiAQ=="
     },
     "@types/normalize-package-data": {
       "version": "2.4.0",
@@ -5094,9 +5094,9 @@
       "dev": true
     },
     "@types/tough-cookie": {
-      "version": "2.3.5",
-      "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.5.tgz",
-      "integrity": "sha512-SCcK7mvGi3+ZNz833RRjFIxrn4gI1PPR3NtuIS+6vMkvmsGjosqTJwRt5bAEFLRz+wtJMWv8+uOnZf2hi2QXTg=="
+      "version": "2.3.6",
+      "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.6.tgz",
+      "integrity": "sha512-wHNBMnkoEBiRAd3s8KTKwIuO9biFtTf0LehITzBhSco+HQI0xkXZbLOD55SW3Aqw3oUkHstkm5SPv58yaAdFPQ=="
     },
     "@types/webpack-env": {
       "version": "1.14.1",