This commit is contained in:
Kenneth Jao 2016-08-10 21:57:04 -04:00
commit bc3aa5ce81
2 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ classes.schema = new SimpleSchema({
}); });
work.schema = new SimpleSchema({ work.schema = new SimpleSchema({
name: {type: String},
class: {type: String}, class: {type: String},
dueDate: {type: Date}, dueDate: {type: Date},
aliases: {type: [String], optional: true}, aliases: {type: [String], optional: true},

View File

@ -66,12 +66,13 @@ Meteor.methods({
found = Meteor.findOne({_id: input.class}) found = Meteor.findOne({_id: input.class})
if (Meteor.user() != null && found != null && found.subscribers.indexOf(Meteor.userId()) != -1 if (Meteor.user() != null && found != null && found.subscribers.indexOf(Meteor.userId()) != -1
&& found.banned.indexOf(Meteor.userId()) === -1 && found.blockEdit.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.submittor = Meteor.userId();
input.confirmations = [Meteor.userId()]; input.confirmations = [Meteor.userId()];
input.reports = []; input.reports = [];
input.done = []; input.done = [];
input.numberdone = 0; input.numberdone = 0;
work.insert(input);
} }
}, },