From 0c84d9acb60176aab0ac7c68cfcc6495c4682e46 Mon Sep 17 00:00:00 2001 From: Kenneth Jao Date: Sat, 27 Aug 2016 18:57:16 -0400 Subject: [PATCH] Made code getting from server function --- hourglass/client/profile/profile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hourglass/client/profile/profile.js b/hourglass/client/profile/profile.js index 80a4e62..abe55dd 100644 --- a/hourglass/client/profile/profile.js +++ b/hourglass/client/profile/profile.js @@ -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++) {