mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added handling for unsuccessful comments API requests
refs https://github.com/TryGhost/Team/issues/2082 - in the event the API doesn't return a 200 OK, we shouldn't be processing the response from it, as we can end up doing weird things if, for example, an error object is returned
This commit is contained in:
parent
fd9401503b
commit
1dab16c9c1
1 changed files with 4 additions and 0 deletions
|
@ -76,6 +76,10 @@
|
|||
body: JSON.stringify({ids})
|
||||
});
|
||||
|
||||
if (rawRes.status !== 200) {
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await rawRes.json();
|
||||
|
||||
for (const [id, count] of Object.entries(res)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue