mirror of
https://gitlab.com/bmcgonag/get_my.git
synced 2026-03-27 00:08:49 +00:00
Updating framework to meteor 3 and later
This commit is contained in:
parent
717994508a
commit
cca29bc591
58 changed files with 2332 additions and 1611 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue