mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-26 15:58:50 +00:00
fixed adding menu items to the menu.
This commit is contained in:
parent
055d574dcc
commit
f12c6bb7c8
2 changed files with 7 additions and 5 deletions
|
|
@ -102,7 +102,7 @@ Template.menuItemsForm.events({
|
|||
} else {
|
||||
// now add this item to the menu
|
||||
const addToMenu = async() => {
|
||||
let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, result, dateSrv);
|
||||
let result2 = await Meteor.callAsync('addto.Menu', menuId, menuItem, addedItem, dateSrv);
|
||||
if (!result2) {
|
||||
console.log(" ERROR adding menuitem to menu: " + error);
|
||||
} else {
|
||||
|
|
@ -123,15 +123,17 @@ Template.menuItemsForm.events({
|
|||
if (menuItem == null || menuItem == "") {
|
||||
Session.set("menuItemErr", true);
|
||||
} else {
|
||||
Meteor.call('addto.Menu', menuId, menuItem, menuItemId, dateSrv, isLinked, function(error, nresult) {
|
||||
if (error) {
|
||||
const addToMenu = async() => {
|
||||
let result = await Meteor.callAsync('addto.Menu', menuId, menuItem, menuItemId, dateSrv, isLinked);
|
||||
if (!result) {
|
||||
console.log(" ERROR adding menuitem to menu: " + error);
|
||||
} else {
|
||||
// console.log("Added item to menu - no problem.");
|
||||
$("#menuItemInp").val("");
|
||||
$("#dateServed").val("");
|
||||
}
|
||||
});
|
||||
}
|
||||
addToMenu();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ Meteor.methods({
|
|||
throw new Meteor.Error('You are not allowed to add items to menus. Make sure you are logged in with valid user credentials.');
|
||||
}
|
||||
|
||||
serveDateActual = new Date(dateSrv);
|
||||
let serveDateActual = new Date(dateSrv);
|
||||
|
||||
return Menus.updateAsync({ _id: menuId }, {
|
||||
$addToSet: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue