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);
}
// const nestedComponentsToEdit = body.components.filter(
// compo => !_.has(compo, 'uid')
// );
const nestedComponentsToEdit = body.components.filter(
compo => !_.has(compo, 'uid')
);
// nestedComponentsToEdit.forEach(compo => {
// ctx.editComponent(compo.uid, compo);
// });
for (let compoToEdit of nestedComponentsToEdit) {
ctx.editComponent(compoToEdit);
}
return component;
})

View File

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