dbSequelize.Pod.findOrCreate(query).asCallback(function (err, result) {
// [ instance, wasCreated ]
- return callback(err, t, result[0])
+ const res = result ? result[0] : null
+ return callback(err, t, res)
})
},
dbSequelize.Author.findOrCreate(query).asCallback(function (err, result) {
// [ instance, wasCreated ]
- return callback(err, t, result[0])
+ const res = result ? result[0] : null
+ return callback(err, t, res)
})
},
}
// Commit transaction
- t.commit()
-
- return callbackEach()
+ return t.commit().asCallback(callbackEach)
})
}, finalCallback)
})