Finished adding the simplest form of Menus.

This commit is contained in:
Brian McGonagill 2022-08-27 16:59:01 -05:00
parent 3290b3086a
commit 075dd57996
9 changed files with 107 additions and 12 deletions

View file

@ -8,6 +8,7 @@ import { Lists } from '../imports/api/lists.js';
import { ListItems } from '../imports/api/listItems.js';
import { Menus } from '../imports/api/menu.js';
import { MenuItems } from '../imports/api/menuItems.js';
import moment from 'moment';
Meteor.publish("SystemConfig", function() {
try {
@ -84,4 +85,14 @@ Meteor.publish("myMenuItems", function(menuId) {
} catch (error) {
console.log(" ERROR pulling list items for this list: " + error);
}
});
Meteor.publish("todayMenuItems", function() {
try {
let todayDate = new Date();
let todaysDate = moment(todayDate).format("MMM D, YYYY");
return MenuItems.find({ serveDate: todaysDate });
} catch (error) {
console.log(" ERROR pulling today's menu items: " + error);
}
});