Product.observe('after save', function(ctx, next){
productHelper.calProduct(ctx.instance);
next();
});
I have above method to do something once a product is updated, but 'after save' is also trigger by create. How can I get trigger only by update but not create?
Many thanks!
loopback": "^3.22.0" "connector": "postgresql"
You can use Remote hooks.
for example:
Product.afterRemote('updateUser', (ctx, userRes, next) => { next() {...code ....} })where
updateUseris my remote method. Change it with your method name or prototype.