diff --git a/src/actions/index.js b/src/actions/index.js index 56164d0..fe98b11 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -9,7 +9,8 @@ export const fetchPosts = () => async (dispatch) => { export const fetchPost = (slug) => async (dispatch) => { const post = await sudoscientist.get('/blog/posts/by-slug/' + slug) const comments = await sudoscientist.get('/blog/comments/' + post.data.id); - const response = { post: post.data, comments: comments.data } + const response = { post: post.data } + response.post.comments = comments.data dispatch({ type: 'FETCH_POST', payload: response }) };