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

@ -42,7 +42,7 @@ Template.modalLinkProducts.events({
let links = M.FormSelect.getInstance(linkSelect).getSelectedValues();
if (typeof links != undefined && links != [] && links != null) {
// let's split these links into their parts, and make an array of objects
for (i=0; i<links.length; i++) {
for (let i=0; i<links.length; i++) {
let linkArray = links[i].split('|');
let key = linkArray[0];
let value = linkArray[1];
@ -50,25 +50,33 @@ Template.modalLinkProducts.events({
linkObjArray.push(linkObj);
}
Meteor.call("add.menuProdLinks", menuItemId, menuItemName, linkObjArray, function(err, result) {
if (err) {
const addMenuProdLinks = async() => {
let result = await Meteor.callAsync("add.menuProdLinks", menuItemId, menuItemName, linkObjArray);
if (!result) {
console.log(" ERROR adding product links to this menu item: " + err);
} else {
Meteor.call('update.menuItemLinked', menuItemId, true, function(err, result) {
if (err) {
console.log(" ERROR adding link to menu item: " + err);
} else {
Meteor.call('link.inMenu', menuItemId, true, function(error, nresult) {
if (error) {
console.log(" ERROR adding link to menu sub-item: " + error);
} else {
showSnackbar("Products added to Menu Item successfully!", "green");
}
});
}
});
updMenuItemLinks();
}
});
}
addMenuProdLinks();
const updMenuItemLinks = async() => {
let result = await Meteor.callAsync('update.menuItemLinked', menuItemId, true);
if (!result) {
console.log(" ERROR adding link to menu item: " + err);
} else {
linkInMenu();
}
}
const linkInMenu = async() => {
let result = await Meteor.callAsync('link.inMenu', menuItemId, true);
if (!result) {
console.log(" ERROR adding link to menu sub-item: " + error);
} else {
showSnackbar("Products added to Menu Item successfully!", "green");
}
}
}
}
});