2022-08-04 19:50:18 -05:00
|
|
|
import { SysConfig } from '../imports/api/systemConfig.js';
|
2022-08-15 18:07:39 -05:00
|
|
|
import { Stores } from '../imports/api/stores.js';
|
|
|
|
|
import { UserConfigOptions } from '../imports/api/userConfigOptions.js';
|
|
|
|
|
import { Products } from '../imports/api/products.js';
|
|
|
|
|
import { Categories } from '../imports/api/category.js';
|
|
|
|
|
import { Locations } from '../imports/api/location.js';
|
2022-08-16 16:46:14 -05:00
|
|
|
import { Lists } from '../imports/api/lists.js';
|
2022-08-23 13:41:21 -05:00
|
|
|
import { ListItems } from '../imports/api/listItems.js';
|
2022-08-04 19:50:18 -05:00
|
|
|
|
|
|
|
|
Meteor.publish("SystemConfig", function() {
|
|
|
|
|
try {
|
|
|
|
|
return SysConfig.find({});
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(" ERROR pulling system config data: " + error);
|
|
|
|
|
}
|
|
|
|
|
});
|
2022-08-15 18:07:39 -05:00
|
|
|
|
|
|
|
|
Meteor.publish('userList', function() {
|
|
|
|
|
return Meteor.users.find({});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish("storeInfo", function() {
|
|
|
|
|
try {
|
|
|
|
|
return Stores.find({ owner: this.userId });
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(" ERROR pulling store data: " + error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish("myProducts", function() {
|
|
|
|
|
try {
|
|
|
|
|
return Products.find({ prodOwner: this.userId });
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(" ERROR pulling product data: " + error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish("myCategories", function() {
|
|
|
|
|
try {
|
|
|
|
|
return Categories.find({ categoryOwner: this.userId });
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(" ERROR pulling category data: " + error);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish("myLocations", function() {
|
|
|
|
|
try {
|
|
|
|
|
return Locations.find({ owner: this.userId });
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(" ERROR pulling location data: " + error);
|
|
|
|
|
}
|
2022-08-16 16:46:14 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish("myLists", function() {
|
|
|
|
|
try {
|
2022-08-23 13:41:21 -05:00
|
|
|
return Lists.find( { $or: [ { listOwner: this.userId, listComplete: false }, { listShared: true, listComplete: false } ] } );
|
2022-08-16 16:46:14 -05:00
|
|
|
} catch (error) {
|
|
|
|
|
console.log(" ERROR pulling list data: " + error);
|
|
|
|
|
}
|
2022-08-23 13:41:21 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Meteor.publish("myListItems", function(listId) {
|
|
|
|
|
try {
|
|
|
|
|
console.log("List Id is: " + listId);
|
|
|
|
|
return ListItems.find({ listId: listId });
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.log(" ERROR pulling list items for this list: " + error);
|
|
|
|
|
}
|
2022-08-15 18:07:39 -05:00
|
|
|
});
|