working on tasks for meteor 3 update

This commit is contained in:
Brian McGonagill 2025-06-24 13:16:42 -05:00
parent f12c6bb7c8
commit ca7bcb1a8f
2 changed files with 23 additions and 9 deletions

View file

@ -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);

View file

@ -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(),