.done()
is deprecated in Waterline. Use .exec()
instead.
How to invoke ModelB.create on ModelA.afterCreate()
Question
I'm trying to execute this (on 0.10.0-rc7):
User.js
afterCreate: function(values, next) {
Token.create({
hash: uuid.v4(),
type: 'email',
user: values.id
}).done(function (err, token) {
console.log(token);
next();
});
}
But I'm receiving an error:
TypeError: Object [object Object] has no method 'done'
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow