mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Add list items from linked menu items
This commit is contained in:
parent
91150f03b2
commit
00a99e0393
11 changed files with 203 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { SysConfig } from '../imports/api/systemConfig';
|
||||
import { MenuItems } from '../imports/api/menuItems';
|
||||
|
||||
Meteor.startup(() => {
|
||||
// code to run on server at startup
|
||||
|
|
@ -18,4 +19,24 @@ Meteor.startup(() => {
|
|||
} else {
|
||||
console.log("Registration policy already set.");
|
||||
}
|
||||
|
||||
// check if the isLInked item exists on menuitems, and if not, add it (data cleanup task)
|
||||
let itemInfoNoLink = MenuItems.find({ isLinked: { $exists: false } }).fetch();
|
||||
console.log("No Ites with isLinked not set: " + itemInfoNoLink.length);
|
||||
if (itemInfoNoLink.length > 0) {
|
||||
console.log("found items with isLinked not set.");
|
||||
console.dir(itemInfoNoLink);
|
||||
let infoLength = itemInfoNoLink.length;
|
||||
for (i=0; i < infoLength; i++) {
|
||||
MenuItems.update({ _id: itemInfoNoLink[i]._id }, {
|
||||
$set: {
|
||||
isLinked: false,
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
// this will show if all items are found to have isLInked set.
|
||||
console.log("No itesm with isLinked not set.");
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue