meteor-collection-hooks icon indicating copy to clipboard operation
meteor-collection-hooks copied to clipboard

What would make .before.insert not fire?

Open polkhovsky opened this issue 8 years ago • 1 comments

I have this hook defined:

DealsCollection.before.insert(function (userId, doc) {
    console.log(doc);
    if (doc.priceDetails.startDate) {
        doc.priceDetails.startDateUTC = Meteor.call("makeUtcDate", doc.priceDetails.startDate);
    }   
});

It never fires. I have DealsCollection.after.insert that fires just fine. Looking for ideas. Thanks.

polkhovsky avatar Mar 27 '16 14:03 polkhovsky

It seems I can't do Meteor.call from inside the hook?

polkhovsky avatar Mar 27 '16 14:03 polkhovsky