From 929f31ef978f4c0cf4b0d389a096e551ca26b21b Mon Sep 17 00:00:00 2001 From: yamanq Date: Fri, 12 Aug 2016 22:05:06 -0400 Subject: [PATCH] bug fixes --- hourglass/server/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hourglass/server/main.js b/hourglass/server/main.js index 7b4b54c..5e4c0d7 100644 --- a/hourglass/server/main.js +++ b/hourglass/server/main.js @@ -191,7 +191,7 @@ Meteor.methods({ var currentclass = classes.findOne({_id: work.findOne({_id: workId}).class}); var authorized = currentclass.moderators.push(currentclass.admin); - if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) { + if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) { Meteor.update({_id: change._id}, {$set: change}); } else if (authorized.indexOf(Meteor.userId()) != -1) { if (change.name.length <= 50 && worktype.indexOf(type) != -1) { @@ -222,8 +222,8 @@ Meteor.methods({ if (currentclass.subscribers.indexOf(Meteor.userId()) != -1 && ["confirmations", "reports", "done"].indexOf(input[1]) != -1 && workobject[input[1]].indexOf(Meteor.userId()) === -1) { - var currentdone = workobject[input[1]].push(Meteor.userId()); - work.update({_id: input[1]}, {$set: {input[1]: currentdone}}); + workobject[input[1]] = workobject[input[1]].push(Meteor.userId()); + work.update({_id: input[1]}, {$set: workobject}); } }, 'deleteWork': function(workId) {