mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-26 15:58:50 +00:00
Just updated menu items to be added correctly in new version
This commit is contained in:
parent
d25ef56591
commit
b5d490c052
1 changed files with 14 additions and 4 deletions
|
|
@ -69,6 +69,10 @@ Template.menuItemsForm.events({
|
|||
let dateSrv = $("#dateServed").val();
|
||||
let menuId = Session.get("menuId");
|
||||
|
||||
if (menuId == null || menuId == "") {
|
||||
console.log(" ---- NO MENU ID! ----");
|
||||
}
|
||||
|
||||
const mie = async() => {
|
||||
let menuItemExists = await MenuItems.findOneAsync({ itemName: menuItem });
|
||||
if (!menuItemExists) {
|
||||
|
|
@ -76,6 +80,7 @@ Template.menuItemsForm.events({
|
|||
notExists();
|
||||
} else {
|
||||
// call to add it to the menu only
|
||||
console.dir(menuItemExists);
|
||||
itExists(menuItemExists);
|
||||
}
|
||||
}
|
||||
|
|
@ -91,18 +96,19 @@ Template.menuItemsForm.events({
|
|||
if (!result) {
|
||||
// console.log(" ERROR adding menu item: " + err);
|
||||
} else {
|
||||
// console.log(" SUCCESS adding menu item.");
|
||||
// console.log(" SUCCESS adding menu item. Result is: " + result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
let addedItem = addMenuItem();
|
||||
let addedItem = await addMenuItem();
|
||||
|
||||
if (!addedItem) {
|
||||
// console.log("Item was not added.");
|
||||
} else {
|
||||
// now add this item to the menu
|
||||
// console.log("Added Item = " + addedItem);
|
||||
const addToMenu = async() => {
|
||||
let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, addedItem, dateSrv);
|
||||
let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, addedItem, dateSrv, false);
|
||||
if (!result2) {
|
||||
// console.log(" ERROR adding menuitem to menu: " + error);
|
||||
} else {
|
||||
|
|
@ -160,7 +166,11 @@ Template.menuItemsForm.events({
|
|||
if (event.which != 13) {
|
||||
let findMenuItem = $("#menuItemInp").val();
|
||||
let menuItemInfo = MenuItems.find({ itemName: {$regex: findMenuItem + '.*', $options: 'i' }}).fetch();
|
||||
if (typeof menuItemInfo != 'undefined' && menuItemInfo != '' && menuItemInfo != null) {
|
||||
if (!menuItemInfo) {
|
||||
console.log("Nothing found in menu items:");
|
||||
console.dir(menuItemInfo);
|
||||
} else {
|
||||
console.dir(menuItemInfo)
|
||||
getMenuItemList(menuItemInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue