Made code getting from server function

This commit is contained in:
Kenneth Jao 2016-08-27 18:57:16 -04:00
parent 47119d4161
commit 0c84d9acb6

View File

@ -200,12 +200,13 @@ Template.profile.helpers({
var usertype = ["moderators","banned"];
var attribute = Session.get("selectClassId");
var array = classes.findOne({_id:attribute});
if(array.code === "") {
var code = Meteor.call('getCode',attribute);
if(code === "") {
array.code = "None";
Session.set("code", false);
} else {
Session.set("code", true);
array.code = code;
}
for(var i = 0; i < usertype.length; i++) {