diff options
Diffstat (limited to 'components/Posts/PostList/index.js')
-rw-r--r-- | components/Posts/PostList/index.js | 17 |
1 files changed, 7 insertions, 10 deletions
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 |