Hi,
I can’t get error on client when I use Meteor.call().
The variable err always set with undefined.
Example:
In Client:
Template.agendamentos.events({
'click #cancelarCompromisso': function() {
Meteor.call("cancel", id, function (err, res) {
if( err){
console.log("Error");
}else{
console.log("Works");
}
});
}
});
In Server:
Meteor.methods({
cancel: function(id){
Register.remove(appointment._id, function(err, res){
if (err) {
throw err;
}
});
}
});