Init nested edits

This commit is contained in:
Alexandre Bodin 2019-11-18 18:03:51 +01:00
parent 6e8b0d17d3
commit e8eb6684f3
2 changed files with 15 additions and 6 deletions

View File

@ -73,13 +73,13 @@ module.exports = {
ctx.createComponent(compoToCreate); ctx.createComponent(compoToCreate);
} }
// const nestedComponentsToEdit = body.components.filter( const nestedComponentsToEdit = body.components.filter(
// compo => !_.has(compo, 'uid') compo => !_.has(compo, 'uid')
// ); );
// nestedComponentsToEdit.forEach(compo => { for (let compoToEdit of nestedComponentsToEdit) {
// ctx.editComponent(compo.uid, compo); ctx.editComponent(compoToEdit);
// }); }
return component; return component;
}) })

View File

@ -165,6 +165,15 @@ const createTransaction = ({ components, contentTypes }) => {
return handler; return handler;
}, },
/**
* create a component in the tmpComponent map
*/
editComponent(infos) {
const { uid } = infos;
return tmpComponents.get(uid);
},
flush() { flush() {
return Promise.all( return Promise.all(
[ [