diff --git a/hourglass/collections/main.js b/hourglass/collections/main.js index 6d28d8a..f6b3959 100644 --- a/hourglass/collections/main.js +++ b/hourglass/collections/main.js @@ -27,6 +27,7 @@ classes.schema = new SimpleSchema({ }); work.schema = new SimpleSchema({ + name: {type: String}, class: {type: String}, dueDate: {type: Date}, aliases: {type: [String], optional: true}, diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 7a4426c..a6d869a 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -66,12 +66,13 @@ Meteor.methods({ found = Meteor.findOne({_id: input.class}) if (Meteor.user() != null && found != null && found.subscribers.indexOf(Meteor.userId()) != -1 && found.banned.indexOf(Meteor.userId()) === -1 && found.blockEdit.indexOf(Meteor.userId()) === -1 - && input.dueDate.getTime() >= ref && worktype.indexOf(type) != -1) { + && input.dueDate.getTime() >= ref && worktype.indexOf(type) != -1 && input.name.length <= 50) { input.submittor = Meteor.userId(); input.confirmations = [Meteor.userId()]; input.reports = []; input.done = []; input.numberdone = 0; + work.insert(input); } },