chore: Promise all leftovers from complex selects

This commit is contained in:
Rafael Taranto 2025-06-24 12:19:47 +01:00
parent 6ede7fab90
commit 686dc3e992

View file

@ -36,37 +36,32 @@ function batch({
simplified, simplified,
}) { }) {
const isCsvExport = _.isBoolean(simplified) const isCsvExport = _.isBoolean(simplified)
return ( return getTransactionList(
Promise.all([ {
getTransactionList( from,
{ until,
from, cryptoCode,
until, txClass,
cryptoCode, deviceId,
txClass, toAddress,
deviceId, customerId,
toAddress, swept,
customerId, status,
swept, excludeTestingCustomers,
status, },
excludeTestingCustomers, { limit, offset },
},
{ limit, offset },
),
])
// Promise.all(promises)
.then(it => addProfits(it[0]))
.then(res =>
!isCsvExport
? res
: // GQL transactions and transactionsCsv both use this function and
// if we don't check for the correct simplified value, the Transactions page polling
// will continuously build a csv in the background
simplified
? simplifiedBatch(res)
: advancedBatch(res),
)
) )
.then(addProfits)
.then(res =>
!isCsvExport
? res
: // GQL transactions and transactionsCsv both use this function and
// if we don't check for the correct simplified value, the Transactions page polling
// will continuously build a csv in the background
simplified
? simplifiedBatch(res)
: advancedBatch(res),
)
} }
function advancedBatch(data) { function advancedBatch(data) {