saveToJSON = {
saveButton
await editor.isReady
editor.save().then((outputData) => {
console.log('Article data: ', outputData)
fetch(JSON_URL, {
method: 'PUT',
body: JSON.stringify(outputData),
headers: {
'Content-Type': 'application/json'
}
})
.then(res => res.json())
.then(response => console.log('Success:', JSON.stringify(response)))
.catch(error => console.error('Error:', error));
}).catch((error) => {
console.log('Saving failed: ', error)
});
}