fix: add timezone to specific tx logs

feat: pass timezone to details row
This commit is contained in:
Sérgio Salgado 2021-06-27 16:56:03 +01:00 committed by Josh Harvey
parent b5e35b82c2
commit 4e88c995d3
6 changed files with 34 additions and 18 deletions

View file

@ -10,7 +10,7 @@ const resolvers = {
logs.simpleGetMachineLogs(deviceId, from, until, limit, offset),
machineLogsCsv: (...[, { deviceId, from, until, limit, offset, timezone }]) =>
logs.simpleGetMachineLogs(deviceId, from, until, limit, offset)
.then(res => parseAsync(dateFormat(timezone, res))),
.then(res => parseAsync(logs.logDateFormat(timezone, res, ['timestamp']))),
serverLogs: (...[, { from, until, limit, offset }]) =>
serverLogs.getServerLogs(from, until, limit, offset),
serverLogsCsv: (...[, { from, until, limit, offset, timezone }]) =>

View file

@ -32,11 +32,15 @@ const resolvers = {
transactions.batch(from, until, limit, offset, deviceId, txClass, machineName, customerName, fiatCode, cryptoCode, toAddress, status),
transactionsCsv: (...[, { from, until, limit, offset, txClass, machineName, customerName, fiatCode, cryptoCode, toAddress, status, timezone }]) =>
transactions.batch(from, until, limit, offset, txClass, machineName, customerName, fiatCode, cryptoCode, toAddress, status)
.then(data => parseAsync(data, { fields: tx_logFields, transforms: logDateFormat(timezone, data, ['created', 'sendTime']) })),
transactionCsv: (...[, { id, txClass }]) =>
transactions.getTx(id, txClass).then(data => parseAsync(data)),
txAssociatedDataCsv: (...[, { id, txClass }]) =>
transactions.getTxAssociatedData(id, txClass).then(data => parseAsync(data)),
.then(data => parseAsync(logDateFormat(timezone, data, ['created', 'sendTime']), { fields: txLogFields })),
transactionCsv: (...[, { id, txClass, timezone }]) =>
transactions.getTx(id, txClass).then(data =>
parseAsync(logDateFormat(timezone, [data], ['created', 'sendTime']))
),
txAssociatedDataCsv: (...[, { id, txClass, timezone }]) =>
transactions.getTxAssociatedData(id, txClass).then(data =>
parseAsync(logDateFormat(timezone, data, ['created']))
),
transactionFilters: () => filters.transaction()
}
}