automatically adds index for new record

This commit is contained in:
Michael Shanks 2019-10-31 09:22:01 +00:00
parent 21287181a2
commit 871949ef5e
1 changed files with 8 additions and 1 deletions

View File

@ -272,6 +272,13 @@ const saveCurrentNode = (store) => () => {
sortBy(newIndexOfchild)
]);
if(!existingNode && s.currentNode.type === "record") {
const defaultIndex = templateApi(s.hierarchy)
.getNewIndexTemplate(cloned.parent());
defaultIndex.name = `all_${cloned.collectionName}`;
defaultIndex.allowedRecordNodeIds = [cloned.nodeId];
}
s.currentNodeIsNew = false;
savePackage(store, s);