I have the following flow to execute:
function doSomething(data, file) {
createObjectOnDB(data).then(req =>
upload(res.body.url, file).then(
getResult(res.body.id)
)
})
}
Do you see the problem? I can't use .then
to chain the upload
and getResult
because both of them are accessing the req
object. Is there any workaround?
Thank you.