mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updating tasks to show incomplete, overdue items
This commit is contained in:
parent
5e80ab7f6b
commit
cf715c9dbf
4 changed files with 37 additions and 4 deletions
|
|
@ -49,6 +49,37 @@ Meteor.methods({
|
|||
}
|
||||
}
|
||||
},
|
||||
'add.mytask' (taskName, assignedTo, assignedToId, taskDate, actDate) {
|
||||
check(taskName, String);
|
||||
check(taskDate, String);
|
||||
check(actDate, Date);
|
||||
|
||||
if (!this.userId) {
|
||||
throw new Meteor.Error('You are not allowed to add tasks. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
let username;
|
||||
|
||||
if (assignedTo == "self") {
|
||||
let userInfo = Meteor.users.findOne({ _id: this.userId });
|
||||
username = userInfo.profile.fullname;
|
||||
assignedToId = this.userId;
|
||||
} else {
|
||||
username = assignedTo;
|
||||
}
|
||||
|
||||
return TaskItems.insert({
|
||||
taskName: taskName,
|
||||
taskDate: taskDate,
|
||||
actualDate: actDate,
|
||||
assignedTo: username,
|
||||
assignedToId: assignedToId,
|
||||
isComplete: false,
|
||||
completedOn: null,
|
||||
assignedOn: new Date(),
|
||||
assignedBy: this.userId,
|
||||
});
|
||||
},
|
||||
'edit.task' (taskId, taskName, assignedTo, taskDate) {
|
||||
check(taskId, String);
|
||||
check(taskName, String);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue