add name to work
This commit is contained in:
parent
e9fc5b28b0
commit
15143172ad
@ -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},
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user