From 2f557ae3a558c654cc6f3befff22f5ee4ea6c3d9 Mon Sep 17 00:00:00 2001 From: Lauri Ojansivu Date: Tue, 14 Aug 2018 01:28:53 +0300 Subject: - Fix Import from Trello error 400. Thanks to xet7 ! --- models/cards.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'models/cards.js') diff --git a/models/cards.js b/models/cards.js index 2c0da093..04348e2f 100644 --- a/models/cards.js +++ b/models/cards.js @@ -6,6 +6,8 @@ Cards = new Mongo.Collection('cards'); Cards.attachSchema(new SimpleSchema({ title: { type: String, + optional: true, + defaultValue: '', }, archived: { type: Boolean, @@ -22,6 +24,8 @@ Cards.attachSchema(new SimpleSchema({ }, listId: { type: String, + optional: true, + defaultValue: '', }, swimlaneId: { type: String, @@ -31,10 +35,14 @@ Cards.attachSchema(new SimpleSchema({ // difficult to manage and less efficient. boardId: { type: String, + optional: true, + defaultValue: '', }, coverId: { type: String, optional: true, + defaultValue: '', + }, createdAt: { type: Date, @@ -49,15 +57,19 @@ Cards.attachSchema(new SimpleSchema({ customFields: { type: [Object], optional: true, + defaultValue: [], }, 'customFields.$': { type: new SimpleSchema({ _id: { type: String, + optional: true, + defaultValue: '', }, value: { type: Match.OneOf(String, Number, Boolean, Date), optional: true, + defaultValue: '', }, }), }, @@ -70,22 +82,28 @@ Cards.attachSchema(new SimpleSchema({ description: { type: String, optional: true, + defaultValue: '' }, requestedBy: { type: String, optional: true, + defaultValue: '', + }, assignedBy: { type: String, optional: true, + defaultValue: '', }, labelIds: { type: [String], optional: true, + defaultValue: '', }, members: { type: [String], optional: true, + defaultValue: [], }, receivedAt: { type: Date, @@ -107,6 +125,7 @@ Cards.attachSchema(new SimpleSchema({ type: Number, decimal: true, optional: true, + defaultValue: 0, }, isOvertime: { type: Boolean, @@ -126,6 +145,7 @@ Cards.attachSchema(new SimpleSchema({ sort: { type: Number, decimal: true, + defaultValue: '', }, subtaskSort: { type: Number, @@ -135,10 +155,12 @@ Cards.attachSchema(new SimpleSchema({ }, type: { type: String, + defaultValue: '', }, linkedId: { type: String, optional: true, + defaultValue: '', }, })); -- cgit v1.2.3-1-g7c22