cannot confirm and approve work at same time

This commit is contained in:
Yaman Qalieh 2016-08-28 19:22:51 -04:00
parent 202df284a3
commit 1a9435a3de

View File

@ -463,6 +463,13 @@ Meteor.methods({
userindex = workobject[input[1]].indexOf(Meteor.userId());
if (userindex === -1) {
workobject[input[1]] = workobject[input[1]].concat(Meteor.userId());
if (input[1] === "confirmations" &&
workobject.reports.indexOf(Meteor.userId()) !== -1) {
workobject.reports.splice(userindex, 1);
} else if (input[1] === "reports" &&
workobject.confirmations.indexOf(Meteor.userId()) !== -1) {
workobject.confirmations.splice(userindex, 1);
}
} else {
workobject[input[1]].splice(userindex, 1);
}