From 1aa3a88b21539aa06572d86324673baeddfbe46f Mon Sep 17 00:00:00 2001 From: Patryk Niedźwiedziński Date: Sat, 25 Jan 2020 19:41:39 +0100 Subject: Add image from meta --- components/Posts/PostList/index.js | 7 ++++--- components/Posts/PostList/parentMixin.js | 4 ++-- package-lock.json | 12 ++++++------ 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", -- cgit 1.4.1