1
我完全陌生于帆联盟。 我想在关联的集合中发布(publishCreate和publishUpdate)套接字事件。publishcreate,publishupdate无法在sailsjs中的关联集合上工作
我得到了Sails publish(Update) system does not propagate to associations 我的代码一种解决方案是像
module.exports = {
attributes: {
title: 'string',
owner:{
model:'user'
}
},
afterUpdate: function(post, cb){
User.publishUpdate(post.owner, {/* props you want to send */});
cb();
}
};
但它不为我工作。
嗨tcruz,感谢您的答复。我想发布关联的填充收集字段,我也使用了该代码。但是,这不会激发关联的收集。 – Aravinth