diff --git a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js index cc8c54bf..d9256f3b 100644 --- a/new-lamassu-admin/src/pages/Customers/CustomerProfile.js +++ b/new-lamassu-admin/src/pages/Customers/CustomerProfile.js @@ -74,6 +74,7 @@ const GET_CUSTOMER = gql` totalTxs totalSpent lastActive + lastUsedMachineName lastTxFiat lastTxFiatCode lastTxClass diff --git a/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js b/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js index 3d1bbcf4..513ab311 100644 --- a/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js +++ b/new-lamassu-admin/src/pages/Customers/components/TransactionsList.js @@ -21,13 +21,7 @@ const TransactionsList = ({ customer, data, loading }) => { const classes = useStyles() const LastTxIcon = customer.lastTxClass === 'cashOut' ? TxOutIcon : TxInIcon const hasData = !(R.isEmpty(data) || R.isNil(data)) - - const lastUsedMachine = R.pipe( - R.sort(R.descend(R.prop('created'))), - R.head, - R.prop('machineName'), - R.defaultTo(null) - )(data) + const { lastUsedMachineName } = customer const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone const tableSpacingClasses = { @@ -76,7 +70,7 @@ const TransactionsList = ({ customer, data, loading }) => { { header: 'Last used machine', size: 198, - value: ifNotNull(lastUsedMachine, <>{lastUsedMachine}) + value: ifNotNull(lastUsedMachineName, <>{lastUsedMachineName}) } ]