Fixed adding comments order

This commit is contained in:
Simon Backx 2022-07-05 16:10:24 +02:00
parent fdeed0eeec
commit 5841241a42
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ async function addComment({state, api, data: comment}) {
};
return {
comments: [...state.comments, commentStructured]
comments: [commentStructured, ...state.comments]
// todo: fix pagination now?
};
}

View File

@ -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');
}