52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import { SysConfig } from "../imports/api/systemConfig";
|
|
import { UpdateInfo } from "../imports/api/updateInfo";
|
|
import { MScripts } from "../imports/api/mScripts";
|
|
import { UserInfo } from "../imports/api/userInfo";
|
|
import { Locations } from "../imports/api/locations";
|
|
import { LocationTypes } from "../imports/api/locationTypes";
|
|
import { Roels } from "meteor/roles";
|
|
|
|
Meteor.publish("SystemConfig", function() {
|
|
try {
|
|
return SysConfig.find({});
|
|
} catch (error) {
|
|
console.log(" ERROR pulling system config data: " + error);
|
|
}
|
|
});
|
|
|
|
Meteor.publish("UpdateVersion", function() {
|
|
try {
|
|
return UpdateInfo.find({ viewed: false });
|
|
} catch(error) {
|
|
console.log(" ERROR pulling updated version info: " + error);
|
|
}
|
|
});
|
|
|
|
Meteor.publish("UserInfo", function() {
|
|
try {
|
|
return this.userId;
|
|
} catch(error) {
|
|
console.log(" ERROR getting user Id: " + error);
|
|
}
|
|
});
|
|
|
|
Meteor.publish(null, function () {
|
|
if (this.userId) {
|
|
return Meteor.roleAssignment.find({ "user._id": this.userId });
|
|
}
|
|
this.ready();
|
|
});
|
|
|
|
Meteor.publish("Locations", function () {
|
|
if (this.userId) {
|
|
return Locations.find({});
|
|
}
|
|
this.ready();
|
|
});
|
|
|
|
Meteor.publish("LocationTypes", function () {
|
|
if (this.userId) {
|
|
return LocationTypes.find({});
|
|
}
|
|
this.ready();
|
|
});
|