Continued migrating to Simpl-Schema and imports

This commit is contained in:
Stefan Zermatten
2018-10-19 14:01:23 +02:00
parent 989706483a
commit 7cda854d22
31 changed files with 391 additions and 710 deletions

View File

@@ -1,6 +1,8 @@
import SimpleSchema from 'simpl-schema';
Proficiencies = new Mongo.Collection("proficiencies");
Schemas.Proficiency = new SimpleSchema({
proficiencySchema = new SimpleSchema({
charId: {
type: String,
regEx: SimpleSchema.RegEx.Id,
@@ -15,7 +17,6 @@ Schemas.Proficiency = new SimpleSchema({
type: Number,
allowedValues: [0, 0.5, 1, 2],
defaultValue: 1,
decimal: true,
},
type: {
type: String,
@@ -28,10 +29,7 @@ Schemas.Proficiency = new SimpleSchema({
},
});
Proficiencies.attachSchema(Schemas.Proficiency);
Proficiencies.attachSchema(proficiencySchema);
Proficiencies.attachBehaviour("softRemovable");
// Proficiencies.attachBehaviour("softRemovable");
makeChild(Proficiencies, ["enabled"]);
Proficiencies.allow(CHARACTER_SUBSCHEMA_ALLOW);
Proficiencies.deny(CHARACTER_SUBSCHEMA_DENY);