Clean props when copying creature -> lib
prevents creature specific fields from leaking into libraries
This commit is contained in:
@@ -132,6 +132,9 @@ function insertNodeFromProperty(propId, ancestors, order, method) {
|
|||||||
prop.order = order;
|
prop.order = order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clean the props
|
||||||
|
props = cleanProps(props);
|
||||||
|
|
||||||
// Insert the props as library nodes
|
// Insert the props as library nodes
|
||||||
LibraryNodes.batchInsert(props);
|
LibraryNodes.batchInsert(props);
|
||||||
return prop;
|
return prop;
|
||||||
@@ -186,4 +189,11 @@ function assertSourceLibraryCopyPermission(props, method) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cleanProps(props) {
|
||||||
|
return props.map(prop => {
|
||||||
|
let schema = LibraryNodes.simpleSchema(prop);
|
||||||
|
return schema.clean(prop);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export default copyPropertyToLibrary;
|
export default copyPropertyToLibrary;
|
||||||
|
|||||||
Reference in New Issue
Block a user