I have add beforeCreate and beforeUpdate hook in sequelize model
hooks: {
beforeCreate: (Coach) => {
Coach.password = getBcryptHashPassword(Coach.password);
},
beforeUpdate: (Coach) => {
if (Coach.password)
Coach.password = getBcryptHashPassword(Coach.password);
},
},
Create time hook treigger properly
But when I can update service hook not trigger
exports.update = async (data, conditions) => {
return Model.update(data,conditions );
};
This is my update service
I want trigger beforeUpdate hook on call update service