automatically adds index for new record
This commit is contained in:
parent
ed6bb4bf62
commit
3c051eea57
|
@ -272,6 +272,13 @@ const saveCurrentNode = (store) => () => {
|
||||||
sortBy(newIndexOfchild)
|
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;
|
s.currentNodeIsNew = false;
|
||||||
|
|
||||||
savePackage(store, s);
|
savePackage(store, s);
|
||||||
|
|
Loading…
Reference in New Issue