diff --git a/apps/comments-ui/src/actions.js b/apps/comments-ui/src/actions.js index 809f334d33..5c091d6db2 100644 --- a/apps/comments-ui/src/actions.js +++ b/apps/comments-ui/src/actions.js @@ -22,7 +22,7 @@ async function addComment({state, api, data: comment}) { }; return { - comments: [...state.comments, commentStructured] + comments: [commentStructured, ...state.comments] // todo: fix pagination now? }; } diff --git a/apps/comments-ui/src/utils/api.js b/apps/comments-ui/src/utils/api.js index 64b0836f9d..e5300baa65 100644 --- a/apps/comments-ui/src/utils/api.js +++ b/apps/comments-ui/src/utils/api.js @@ -90,7 +90,7 @@ function setupGhostApi({siteUrl = window.location.origin, apiUrl, apiKey}) { credentials: 'same-origin' }).then(function (res) { if (res.ok) { - return res.json() + return res.json(); } else { throw new Error('Failed to fetch comments'); }