how can i do the following with bluebird promises. modules i am using are bluebird
, promise-mysql
I am using native queries.
The general idea is:
insetA()
.then(function(a_id){
return Promise.all([inserB(a_id), inserC(a_id)])
})
.then(function(){
res.send("all good")
})
.catch(function(error){
res.send("some error")
})
function insetA(){
return new Promise(function (resolve, reject) {
// inserting A
// resolve(a_id)
})
}