Javascript 如何在AfterCreate中访问请求对象-waterline,sails
我有两个模型:paper.js和Reader.jsJavascript 如何在AfterCreate中访问请求对象-waterline,sails,javascript,node.js,express,sails.js,waterline,Javascript,Node.js,Express,Sails.js,Waterline,我有两个模型:paper.js和Reader.js // Newspaper module.exports = { attributes: { title: { type: 'string' }, } }; 和读者 //Reader module.exports = { attributes: { // In case if the message is poll, it has options field which enumerate
// Newspaper
module.exports = {
attributes: {
title: {
type: 'string'
},
}
};
和读者
//Reader
module.exports = {
attributes: {
// In case if the message is poll, it has options field which enumerates choices.
title: {
type: 'string'
},
}
};
以及存储它们之间多对多关系的模型
module.exports = {
attributes: {
newsPaper: {
model: 'newsPaper'
},
reader: {
model: 'reader'
}
}
};
当新读者加入多个订阅时,我的客户会给我打电话,我会在电话中以数组的形式收到新闻稿
我在《读者追问》中列出了新闻报纸,但没有创建读者ID。我得到了在AfterCreate中创建的新阅读器的ID,但没有报纸
创建读卡器条目后,如何创建关系?您必须将代码张贴在实际处理来电的位置。我使用的是blueprint方法。创建新的读卡器时没有在控制器中编写代码。好的,那么我完全不明白您需要什么帮助。也许你能改写一下你的问题吗?我想问一个优雅的方法来存储新的读者以及使用蓝图方法的读者地图和报纸。我想知道我是否能在不覆盖创建蓝图方法的情况下解决这个问题。