Commit adb48925 authored by marioromera's avatar marioromera
Browse files

await response json

parent 21177bec
......@@ -123,11 +123,15 @@ async function getRevisions() {
const response = await fetch(
`${etherpadUrl}/api/1/getRevisionsCount?apikey=${etherpadApiKey}&padID=${PAD_ID}`
);
).catch(e => {
logger.warn('Connection error', e);
});
const etherpadJson = response.json();
if (!etherpadJson.data) {
logger.warn('No revisions found', etherpadJson);
const etherpadJson = response && await response.json();
if (!etherpadJson) {
logger.warn('No revisions found');
return
}
return etherpadJson.data;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment