After inserting a record into a collection in a server side method I route to a different named route. But I get an error : “has no method ‘go’”.
Meteor.methods({
'create_item': function (item) {
Items.insert(item, function (error,result){
if(result){
Router.go('dashboard');
}
});
},
});
The route changes successfully and the page renders the dashboard template, but I get the following error.
I20160526-12:00:15.662(3)? Exception in callback of async function: TypeError: Object function router(req, res, next) {
I20160526-12:00:15.662(3)? router.dispatch(req.url, {
I20160526-12:00:15.662(3)? //XXX this assumes no other routers on the parent stack which we should probably fix
I20160526-12:00:15.662(3)? request: req,
I20160526-12:00:15.663(3)? }, next);
I20160526-12:00:15.662(3)? response: res
I20160526-12:00:15.663(3)? } has no method ‘go’
I20160526-12:00:15.663(3)? at lib/methods.js:17:16