log errors on client if error

This commit is contained in:
Kenneth Jao 2017-04-25 22:27:30 -04:00
parent 550d2e71fe
commit e5963b8a6b
2 changed files with 3 additions and 2 deletions

View File

@ -858,8 +858,9 @@ sendData = function(funcName) { // Call Meteor function, and do actions after fu
if(funcName === "editProfile") filterWork();
Meteor.call(funcName, serverData, function(error, result) {
serverData = null;
if (error !== undefined) {
console.log(funcName);
console.log(error);
sAlert.error(error.error[1] || error.message, {
effect: 'stackslide',
position: 'top'

View File

@ -515,7 +515,7 @@ Meteor.methods({
var security = securityCheck([[[8, 9, true], 16, false], 10, 20, 11, 12, true],
Object.assign({}, found || {}, input, {userId: Meteor.userId()}));
if (!security) {
input = Object.assign({}, input, {confirmations: [Meteor.userId()], reports: [], done: [], numberdone: 0, comments: []});
input = Object.assign({}, input, {confirmations: [Meteor.userId()], reports: [], done: [], comments: []});
work.insert(input);
} else {
throw new Meteor.Error(errors[security]);