Many changes aded to system.

This commit is contained in:
Brian McGonagill 2026-01-24 13:49:38 -06:00
parent e0571d14b7
commit 5ba618f471
22 changed files with 640 additions and 57 deletions

View file

@ -11,9 +11,12 @@ Meteor.methods({
if (user) {
let userId = user._id;
if (countOfUsers > 1) {
await Roles.addUsersToRolesAsync(userId, role);
let addedRole = await Roles.addUsersToRolesAsync(userId, role);
} else if (countOfUsers == 1) {
await Roles.addUsersToRolesAsync(userId, "systemadmin");
let addedRole = await Roles.addUsersToRolesAsync(userId, "systemadmin");
if (addedRole) {
await Meteor.callAsync('addUserToTenant', userId, "000001");
}
} else {
console.log("The count of users didn't seem to work when adding a new user.");
}

View file

@ -2,6 +2,8 @@ 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() {
@ -34,3 +36,17 @@ Meteor.publish(null, function () {
}
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();
});