Added schema defaults to all schemas to prevent strings from being trimmed

This commit is contained in:
Stefan Zermatten
2019-02-06 17:32:08 +02:00
parent bf2e9439cf
commit b67926e0fc
38 changed files with 100 additions and 50 deletions

View File

@@ -1,8 +1,9 @@
import SimpleSchema from 'simpl-schema';
import schema from '/imports/api/schema.js';
Libraries = new Mongo.Collection("library");
librarySchema = new SimpleSchema({
librarySchema = schema({
name: {type: String},
owner: {type: String, regEx: SimpleSchema.RegEx.Id},
readers: {type: Array, defaultValue: []},

View File

@@ -1,9 +1,10 @@
import SimpleSchema from 'simpl-schema';
import schema from '/imports/api/schema.js';
import libraryAttacksSchema from "/imports/api/library/";
LibraryItems = new Mongo.Collection("libraryItems");
libraryItemsSchema = new SimpleSchema({
libraryItemsSchema = schema({
libraryName:{type: String, optional: true, trim: false},
name: {type: String, defaultValue: "New Item", trim: false},
plural: {type: String, optional: true, trim: false},

View File

@@ -1,6 +1,6 @@
LibrarySpells = new Mongo.Collection("librarySpells");
Schemas.LibrarySpells = new SimpleSchema({
Schemas.LibrarySpells = schema({
name: {
type: String,
trim: false,

View File

@@ -1,6 +1,7 @@
import SimpleSchema from 'simpl-schema';
import schema from '/imports/api/schema.js';
libraryAttacksSchema = new SimpleSchema({
libraryAttacksSchema = schema({
name: {
type: String,
defaultValue: "New Attack",

View File

@@ -1,6 +1,7 @@
import SimpleSchema from 'simpl-schema';
import schema from '/imports/api/schema.js';
libraryEffectsSchema = new SimpleSchema({
libraryEffectsSchema = schema({
name: {
type: String,
optional: true, //TODO make necessary if there is no owner