mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updated Tasks for multi-select
This commit is contained in:
parent
301c66eeba
commit
aa8ea1ecb1
3 changed files with 61 additions and 27 deletions
|
|
@ -12,12 +12,12 @@ TaskItems.allow({
|
|||
});
|
||||
|
||||
Meteor.methods({
|
||||
'add.task' (taskName, assignedTo, assignedToId, taskDate, actDate) {
|
||||
check(taskName, String);
|
||||
'add.task' (taskNameArr, assignedTo, assignedToId, taskDateArr, actDate) {
|
||||
check(taskNameArr, [Object]);
|
||||
check(assignedTo, String);
|
||||
check(taskDate, String);
|
||||
check(taskDateArr, [String]);
|
||||
check(assignedToId, String);
|
||||
check(actDate, Date);
|
||||
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.');
|
||||
|
|
@ -33,17 +33,21 @@ Meteor.methods({
|
|||
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,
|
||||
});
|
||||
for (i=0; i < taskDateArr.length; i++) {
|
||||
for (j=0; j < taskNameArr.length; j++) {
|
||||
TaskItems.insert({
|
||||
taskName: taskNameArr[j].tag,
|
||||
taskDate: taskDateArr[i],
|
||||
actualDate: actDate[i],
|
||||
assignedTo: username,
|
||||
assignedToId: assignedToId,
|
||||
isComplete: false,
|
||||
completedOn: null,
|
||||
assignedOn: new Date(),
|
||||
assignedBy: this.userId,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
'edit.task' (taskId, taskName, assignedTo, taskDate) {
|
||||
check(taskId, String);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue