Hello,
I would like to start the migration to 2.8 but I am a bit lost.
The most common pattern we have in our code is calling a method from the client when submitting a form for example. I would like to start migrating this code.
For example
Template.myBlazeTemplate.events({
'click a#new-team': function (e) {
e.preventDefault();
Meteor.call('new-team', function (err, teamId) {
if (err) {
console.error(err);
toastr.error(TAPi18n.__(err.reason));
return;
}
toastr.success(TAPi18n.__('Team created'));
Session.set('teamId', teamId);
});
},
});
Does this code on the client needs to be changed ?
On the server (server only) we define the method that interact with the DB
If I understand well, everywhere where I use findOne, update, … I have to replace with the findOneAsync, … and add the keywords async and await.
This is an enormous amount of code rewrite !