mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-26 15:58:50 +00:00
working on tasks for meteor 3 update
This commit is contained in:
parent
f12c6bb7c8
commit
ca7bcb1a8f
2 changed files with 23 additions and 9 deletions
|
|
@ -47,7 +47,7 @@ Template.myTasksForm.events({
|
|||
}
|
||||
}
|
||||
|
||||
console.log("Date Error: " + taskDateErr + " - Name Error: " + taskNameErr);
|
||||
// console.log("Date Error: " + taskDateErr + " - Name Error: " + taskNameErr);
|
||||
if (taskDateErr == false && taskNameErr == false) {
|
||||
const addTask = async() => {
|
||||
let result = await Meteor.callAsync("add.task", taskNameArray, "self", "selfId", taskDateArray, actDate);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ Meteor.methods({
|
|||
}
|
||||
|
||||
let username;
|
||||
let usInfo;
|
||||
|
||||
if (assignedTo == "self") {
|
||||
const uInfo = async() => {
|
||||
|
|
@ -34,21 +35,29 @@ Meteor.methods({
|
|||
} else {
|
||||
username = userInfo.profile.fullname;
|
||||
assignedToId = this.userId;
|
||||
let usInf = { "username": username, "assignedToId": assignedToId };
|
||||
console.log("setting username = " + username +", and id = " + assignedToId);
|
||||
return usInf;
|
||||
}
|
||||
}
|
||||
uInfo();
|
||||
usInfo = uInfo();
|
||||
console.dir(usInfo);
|
||||
} else {
|
||||
username = assignedTo;
|
||||
usInfo = { "username": assignedTo, "assignedToId": assignedToId };
|
||||
console.log("Set username = " + assignedTo);
|
||||
}
|
||||
|
||||
for (i=0; i < taskDateArr.length; i++) {
|
||||
for (j=0; j < taskNameArr.length; j++) {
|
||||
console.log("assignedToId = " + usInfo.assignedToId);
|
||||
|
||||
for (let i=0; i < taskDateArr.length; i++) {
|
||||
for (let j=0; j < taskNameArr.length; j++) {
|
||||
TaskItems.insertAsync({
|
||||
taskName: taskNameArr[j].id,
|
||||
taskDate: taskDateArr[i],
|
||||
actualDate: actDate[i],
|
||||
assignedTo: username,
|
||||
assignedToId: assignedToId,
|
||||
assignedTo: usInfo.username,
|
||||
assignedToId: usInfo.assignedToId,
|
||||
isComplete: false,
|
||||
completedOn: null,
|
||||
assignedOn: new Date(),
|
||||
|
|
@ -56,6 +65,7 @@ Meteor.methods({
|
|||
});
|
||||
}
|
||||
}
|
||||
return;
|
||||
},
|
||||
'add.mytask' (taskName, assignedTo, assignedToId, taskDate, actDate) {
|
||||
check(taskName, String);
|
||||
|
|
@ -67,6 +77,7 @@ Meteor.methods({
|
|||
}
|
||||
|
||||
let username;
|
||||
let usInfo;
|
||||
|
||||
if (assignedTo == "self") {
|
||||
const uInfo = async() => {
|
||||
|
|
@ -76,19 +87,22 @@ Meteor.methods({
|
|||
} else {
|
||||
username = userInfo.profile.fullname;
|
||||
assignedToId = this.userId;
|
||||
let usinf = { username: username, assignedToId: assignedToId };
|
||||
return usinf;
|
||||
}
|
||||
}
|
||||
uInfo();
|
||||
usInfo = uInfo();
|
||||
} else {
|
||||
username = assignedTo;
|
||||
usInfo = { username: assignedTo, assignedToId: assignedToId };
|
||||
}
|
||||
|
||||
return TaskItems.insertAsync({
|
||||
taskName: taskName,
|
||||
taskDate: taskDate,
|
||||
actualDate: actDate,
|
||||
assignedTo: username,
|
||||
assignedToId: assignedToId,
|
||||
assignedTo: usInfo.username,
|
||||
assignedToId: usInfo.assignedToId,
|
||||
isComplete: false,
|
||||
completedOn: null,
|
||||
assignedOn: new Date(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue