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

@ -20,23 +20,37 @@ Meteor.methods({
throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
}
let curr = SysConfig.findOne({});
if (typeof curr != 'undefined') {
let configId = curr._id;
Meteor.call('edit.noSysAdminReg', configId, admReg, genReg, function(err, result) {
if (err) {
console.log(" ERROR updating sys admin reg: " + err);
const currConfig = async() => {
let curr = await SysConfig.findOneAsync({});
if (!curr) {
try {
return SysConfig.insertAsync({
SysAdminReg: admReg,
dateAdded: new Date(),
allowReg: genReg,
});
} catch(error) {
console.log(" ERROR trying to insert system config:");
console.log(error.message);
console.log(error.stack);
}
} else {
try {
let configId = curr._id;
const addNoSys = await Meteor.callAsync('edit.noSysAdminReg', configId, admReg, genReg);
if (!addNoSys) {
console.log(" Couldn't edit the system config.");
} else {
console.log("Success updating sys admin reg.");
}
});
} else {
return SysConfig.insert({
SysAdminReg: admReg,
dateAdded: new Date(),
allowReg: genReg,
});
} catch(error) {
console.log(" ERROR trying to pull current system config:");
console.log(error.message);
console.log(error.stack);
}
}
}
currConfig();
},
'edit.noSysAdminReg' (configId, canReg, genReg) {
check(canReg, Boolean);
@ -47,7 +61,7 @@ Meteor.methods({
throw new Meteor.Error('Not able to change registration setting. Make sure you are logged in with valid system administrator credentials.');
}
return SysConfig.update({ _id: configId }, {
return SysConfig.updateAsync({ _id: configId }, {
$set: {
SysAdminReg: canReg,
allowReg: genReg,
@ -66,7 +80,7 @@ Meteor.methods({
let configId = curr._id;
return SysConfig.update({ _id: configId }, {
return SysConfig.updateAsync({ _id: configId }, {
$set: {
allowUpdates: allowUpdate,
}