object setting bug
This commit is contained in:
parent
8ce0b46b65
commit
460ce03c0f
@ -185,7 +185,8 @@ Meteor.methods({
|
|||||||
var foundclass = Meteor.findOne({_id: input[1]});
|
var foundclass = Meteor.findOne({_id: input[1]});
|
||||||
var userlist = input[2];
|
var userlist = input[2];
|
||||||
var index = possiblelist.indexOf(input[2]);
|
var index = possiblelist.indexOf(input[2]);
|
||||||
var set = {userlist: foundclass[userlist].splice(foundclass[userlist].indexOf(input[0]))};
|
var set = {};
|
||||||
|
set[userlist] = foundclass[userlist].splice(foundclass[userlist].indexOf(input[0]));
|
||||||
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
if (Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin'])) {
|
||||||
classes.update({_id: input[1]}, {$set: set});
|
classes.update({_id: input[1]}, {$set: set});
|
||||||
} else if (foundclass && foundclass.admin == Meteor.userId() && index !== -1 &&
|
} else if (foundclass && foundclass.admin == Meteor.userId() && index !== -1 &&
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user