Updating framework to meteor 3 and later

This commit is contained in:
Brian McGonagill 2025-06-21 07:28:59 -05:00
parent 717994508a
commit cca29bc591
58 changed files with 2332 additions and 1611 deletions

View file

@ -1,4 +1,5 @@
import { SysConfig } from "../../../imports/api/systemConfig.js";
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
Template.reg.onCreated(function() {
this.subscribe("SystemConfig");
@ -29,12 +30,15 @@ Template.reg.helpers({
return Session.get("missingReq");
},
allowReg: function() {
let conf = SysConfig.findOne();
if (typeof conf != 'undefined') {
return conf.allowReg;
} else {
return true
const sysConf = async() => {
let conf = await SysConfig.findOneAsync();
if (!conf) {
return true;
} else {
return conf.allowReg;
}
}
sysConf();
}
});
@ -84,14 +88,16 @@ Template.reg.events({
let userId = Meteor.userId();
console.log("User ID: " + userId);
Meteor.call("addToRole", "user", function(err, result) {
if (err) {
console.log(" ERROR: ROLES - Error adding user to role: " + err);
const addRole = async() => {
let result = await Meteor.callAsync("addToRole", "user");
if (!result) {
console.log(" ERROR: ROLES - Error adding user to role: ");
} else {
// console.log("User should be added to role - teacher.");
FlowRouter.go('/dashboard');
}
});
}
addRole();
}
}
},