Making it so that Menu and Lists load from db when refreshed.

This commit is contained in:
Brian McGonagill 2024-07-30 11:37:55 -05:00
parent 3ad8fab67b
commit 2f3f82477a
7 changed files with 47 additions and 19 deletions

View file

@ -28,11 +28,17 @@ Template.mainMenuTbl.events({
if (menuId == "addMenu") {
// console.log("add menu clicked");
} else {
console.log("menuId is: " + menuId);
Session.set("menuId", menuId);
Meteor.setTimeout(function() {
FlowRouter.go('/menuitems');
}, 100);
// 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);
} else {
Session.set("menuId", menuId);
Meteor.setTimeout(function() {
FlowRouter.go('/menuitems');
}, 100);
}
});
}
} else if (sender.localName == "i") {
let menuId = this._id;