Updating framework to meteor 3 and later

This commit is contained in:
Brian McGonagill 2025-06-21 07:28:59 -05:00
parent 717994508a
commit cca29bc591
58 changed files with 2332 additions and 1611 deletions

View file

@ -1,5 +1,6 @@
import { Menus } from '../../imports/api/menu.js';
import { M } from '../lib/assets/materialize.js';
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
Template.mainMenuTbl.onCreated(function() {
this.subscribe("myMenus");
@ -21,41 +22,48 @@ Template.mainMenuTbl.events({
'click li.collection-item' (event) {
event.preventDefault();
let sender = event.target;
// console.log("Sender origination from: ");
// console.log("Sender originated from: ");
// console.log(sender.localName);
if (sender.localName == "li") {
let menuId = event.currentTarget.id;
if (menuId == "addMenu") {
// console.log("add menu clicked");
console.log("add menu clicked");
} else {
// console.log("menuId is: " + menuId);
Meteor.call('add.userLast', "Menu", menuId, function(err, result) {
if (err) {
console.log(" ERROR writing last menu viewed by user to db: " + err);
console.log("menuId is: " + menuId);
const addUserLast = async() => {
let result = await Meteor.callAsync('add.userLast', "Menu", menuId);
if (!result) {
console.log(" ERROR writing last menu viewed by user to db.");
} else {
Session.set("menuId", menuId);
Meteor.setTimeout(function() {
FlowRouter.go('/menuitems');
}, 100);
}
});
}
addUserLast();
}
} else if (sender.localName == "i") {
let menuId = this._id;
Meteor.call("markMenu.complete", menuId, function(err, result) {
if (err) {
console.log(" ERROR: can't mark menu complete: " + err);
const makrMenuComp = async() => {
let result = await Meteor.callAsync("markMenu.complete", menuId);
if (!result) {
console.log(" ERROR: can't mark menu complete.");
} else {
console.log(" SUCCESS marking menu complete.");
Meteor.call('setAllMade.menuItem', menuId, function(err, result) {
if (err) {
console.log(" ERROR: cannot set all items as made: " + err);
} else {
console.log(" SUCCESS setting all items made.");
}
});
setAllMade();
}
});
}
makrMenuComp();
const setAllMade = async() => {
let result = await Meteor.callAsync('setAllMade.menuItem', menuId);
if (!result) {
console.log(" ERROR: cannot set all items as made.");
} else {
console.log(" SUCCESS setting all items made.");
}
}
}
},
});