methods now use correct mixins

This commit is contained in:
Stefan Zermatten
2019-04-01 13:48:39 +02:00
parent d21827106c
commit a94f437ba8
17 changed files with 160 additions and 158 deletions

View File

@@ -79,7 +79,6 @@ let AttributeSchema = schema({
});
AttributeSchema.extend(ColorSchema);
AttributeSchema.extend(PropertySchema);
const ComputedAttributeSchema = schema({
// The computed value of the attribute
@@ -94,6 +93,7 @@ const ComputedAttributeSchema = schema({
},
}).extend(AttributeSchema);
Attributes.attachSchema(PropertySchema);
Attributes.attachSchema(ComputedAttributeSchema);
Attributes.attachSchema(ChildSchema);
@@ -125,7 +125,7 @@ const updateAttribute = new ValidatedMethod({
],
collection: Attributes,
permission: 'edit',
updateSchema: AttributeSchema,
schema: AttributeSchema.omit(['adjutment']),
skipRecompute({update}){
let fields = getModifierFields(update);
return !fields.hasAny([
@@ -134,9 +134,6 @@ const updateAttribute = new ValidatedMethod({
'baseValue',
]);
},
run({_id, update}) {
return Attributes.update(_id, update);
},
});
const adjustAttribute = new ValidatedMethod({