Library attribute insert form complete
This commit is contained in:
@@ -26,11 +26,14 @@ let AttributeSchema = schema({
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
defaultValue: 'New Attribute',
|
||||
},
|
||||
// The technical, lowercase, single-word name used in formulae
|
||||
variableName: {
|
||||
type: String,
|
||||
regEx: VARIABLE_NAME_REGEX,
|
||||
min: 3,
|
||||
defaultValue: 'newAttribute',
|
||||
},
|
||||
// How it is displayed and computed is determined by type
|
||||
type: {
|
||||
@@ -46,6 +49,7 @@ let AttributeSchema = schema({
|
||||
'spellSlot', // Level 1, 2, 3... spell slots
|
||||
'utility', // Aren't displayed, Jump height, Carry capacity
|
||||
],
|
||||
defaultValue: 'stat',
|
||||
index: 1,
|
||||
},
|
||||
// The starting value, before effects
|
||||
|
||||
@@ -65,10 +65,7 @@ function assertNodeEditPermission(node, userId){
|
||||
|
||||
const insertNode = new ValidatedMethod({
|
||||
name: 'LibraryNodes.methods.insert',
|
||||
mixins: [
|
||||
simpleSchemaMixin,
|
||||
],
|
||||
schema: LibraryNodeSchema,
|
||||
validate: null,
|
||||
run(libraryNode) {
|
||||
assertNodeEditPermission(libraryNode, this.userId);
|
||||
return LibraryNodes.insert(libraryNode);
|
||||
|
||||
Reference in New Issue
Block a user