Updates for async and await - still

This commit is contained in:
Brian McGonagill 2025-07-22 13:50:49 -05:00
parent febb36d75f
commit 706c5dc3ef
18 changed files with 220 additions and 233 deletions

View file

@ -12,7 +12,7 @@ SysConfig.allow({
});
Meteor.methods({
'add.noSysAdminReg' (admReg, genReg) {
async 'add.noSysAdminReg' (admReg, genReg) {
check(admReg, Boolean);
check(genReg, Boolean);
@ -24,7 +24,7 @@ Meteor.methods({
let curr = await SysConfig.findOneAsync({});
if (!curr) {
try {
return SysConfig.insertAsync({
return await SysConfig.insertAsync({
SysAdminReg: admReg,
dateAdded: new Date(),
allowReg: genReg,
@ -52,7 +52,7 @@ Meteor.methods({
}
currConfig();
},
'edit.noSysAdminReg' (configId, canReg, genReg) {
async 'edit.noSysAdminReg' (configId, canReg, genReg) {
check(canReg, Boolean);
check(configId, String);
check(genReg, Boolean);
@ -61,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.updateAsync({ _id: configId }, {
return await SysConfig.updateAsync({ _id: configId }, {
$set: {
SysAdminReg: canReg,
allowReg: genReg,
@ -69,7 +69,7 @@ Meteor.methods({
}
});
},
'allow.updateInfo' (allowUpdate) {
async 'allow.updateInfo' (allowUpdate) {
check(allowUpdate, Boolean);
if (!this.userId) {
@ -80,7 +80,7 @@ Meteor.methods({
let configId = curr._id;
return SysConfig.updateAsync({ _id: configId }, {
return await SysConfig.updateAsync({ _id: configId }, {
$set: {
allowUpdates: allowUpdate,
}