I tried to apply the DRY method, and I ended creating a lot of many little Meteor function. But I’m facing a problem I cannot solve.
I want to add a notification when a user join an event. So I Meteor.call the userRegistration method. Inside this method, I call the addNotification method. Inside this method, I add a notification in the DB and then call the getUsersToNotify method (that get the user that active the mail notification). But in the callback of this method, I can not access anymore to the notificationID to send… -_-
Do I have to make all the DB request in one meteor method to avoid calling Meteor.call and losing access to the object out of the callback function?
Another (better I think) solution but I cannot make it work, it’s running the notification part only in server side to be able to call all the meteor.call synchronously… But How can I do that?