Skip to content
Snippets Groups Projects
Commit 50766276 authored by Marco Fernandes's avatar Marco Fernandes
Browse files

Fix block resolver.

parent dfdbc8e2
No related branches found
Tags 10.1.10
No related merge requests found
......@@ -49,28 +49,12 @@
`);
const block = await response.json();
dispatch('drupal').setBlock(item, block);
return block;
return {
type: 'GET_BLOCK',
item,
block,
};
},
// getBlock(item) {
// return new Promise((resolve, reject) => {
// fetch(`${drupalSettings.path.baseUrl}editor/blocks/load/${item}`)
// .then(response => {
// response
// .json()
// .then(block => {
// console.log(item, block);
// dispatch('drupal').setBlock(item, block);
// resolve(block);
// })
// .catch(err => {
// reject(err);
// });
// })
// .catch(err => {
// reject(err);
// });
// });
// },
},
});
}
......
......@@ -79,7 +79,11 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
block = _context.sent;
dispatch('drupal').setBlock(item, block);
return _context.abrupt('return', block);
return _context.abrupt('return', {
type: 'GET_BLOCK',
item: item,
block: block
});
case 8:
case 'end':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment