diff --git a/client/Dashboard/dashboard.js b/client/Dashboard/dashboard.js
index bf899f0..a1c3ee0 100644
--- a/client/Dashboard/dashboard.js
+++ b/client/Dashboard/dashboard.js
@@ -49,6 +49,12 @@ Template.dashboard.helpers({
let now = new Date();
let todayDate = moment(now).format("MMM D, YYYY");
return todayDate;
+ },
+ nextDays: function() {
+ let now = new Date();
+ let nowDate = moment(now).add(1, 'day').format("MM D, YYYY");
+ console.log("nowDate = " + nowDate);
+ return MenuItems.find({ serveDate: nowDate });
}
});
diff --git a/client/Menus/mainMenuTbl.js b/client/Menus/mainMenuTbl.js
index f12e846..9499591 100644
--- a/client/Menus/mainMenuTbl.js
+++ b/client/Menus/mainMenuTbl.js
@@ -38,6 +38,13 @@ Template.mainMenuTbl.events({
console.log(" ERROR: can't mark menu complete: " + err);
} 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.");
+ }
+ });
}
});
}
diff --git a/imports/api/menuItems.js b/imports/api/menuItems.js
index 2f33efb..339eaf9 100644
--- a/imports/api/menuItems.js
+++ b/imports/api/menuItems.js
@@ -45,6 +45,21 @@ Meteor.methods({
}
});
},
+ 'setAllMade.menuItem' (menuId) {
+ check(menuId, String);
+
+ if (!this.userId) {
+ throw new Meteor.Error('You are not allowed to set all items as made. Make sure you are logged in with valid user credentials.');
+ }
+
+ return MenuItems.update({ menuId: menuId }, {
+ $set: {
+ itemMade: true,
+ }
+ }, {
+ multi: true
+ });
+ },
'setNotMade.menuItem' (itemId) {
check(itemId, String);