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,16 +1,17 @@
Notes = new Mongo.Collection("notes");
import SimpleSchema from 'simpl-schema';
import ColorSchema from "/imports/api/creature/subSchemas/ColorSchema.js";
Schemas.Note = new SimpleSchema({
let Notes = new Mongo.Collection("notes");
noteSchema = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id, index: 1},
name: {type: String, optional: true, trim: false},
description: {type: String, optional: true, trim: false},
});
Notes.attachSchema(Schemas.Note);
Attributes.attachSchema(ColorSchema);
Notes.attachSchema(noteSchema);
Notes.attachSchema(ColorSchema);
Notes.attachBehaviour("softRemovable");
//Notes.attachBehaviour("softRemovable");
Notes.allow(CHARACTER_SUBSCHEMA_ALLOW);
Notes.deny(CHARACTER_SUBSCHEMA_DENY);
export default Notes;