I want to create dynamic content from api in Grapejs please check code what is the issue. Please advice me thanks
import axios from 'axios'
export default (editor, opts = {}) => {
const str = 'Bearer '+token;
axios({
url: 'getData',
method: 'get',
headers: {
'Authorization': str,
}
})
.then(response => {
console.log(response.data.projectSummary);
})
.catch(err => {
console.log(err);
});
const bm = editor.BlockManager;
bm.add(opts.name, {
label: `Test`,
category: opts.category,
content: `<div class="documet-content"></div>`,
});
};