fix: trade promises chain errors
This commit is contained in:
parent
89d555de89
commit
aa0d143679
2 changed files with 6 additions and 3 deletions
|
|
@ -617,7 +617,10 @@ function plugins (settings, deviceId) {
|
|||
const sql = pgp.helpers.insert(tradeEntry, null, 'trades') + 'RETURNING *'
|
||||
return db.tx(t => {
|
||||
return t.oneOrNone(sql)
|
||||
.then(newTrade => recordTradeAndTx(newTrade.id, _tradeEntry, t))
|
||||
.then(newTrade => {
|
||||
return recordTradeAndTx(newTrade.id, _tradeEntry, t)
|
||||
.then(() => newTrade)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue