Added schema defaults to all schemas to prevent strings from being trimmed
This commit is contained in:
@@ -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: []},
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
LibrarySpells = new Mongo.Collection("librarySpells");
|
||||
|
||||
Schemas.LibrarySpells = new SimpleSchema({
|
||||
Schemas.LibrarySpells = schema({
|
||||
name: {
|
||||
type: String,
|
||||
trim: false,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user