From ce8295e54a21d7460c257ea32d395c1217fba1f3 Mon Sep 17 00:00:00 2001 From: siiky Date: Mon, 10 Oct 2022 16:05:34 +0100 Subject: [PATCH] refactor: use proft calculated in GraphQL resolver --- .../Dashboard/SystemPerformance/Graphs/RefLineChart.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefLineChart.js b/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefLineChart.js index 4c3ea952..8fafd220 100644 --- a/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefLineChart.js +++ b/new-lamassu-admin/src/pages/Dashboard/SystemPerformance/Graphs/RefLineChart.js @@ -4,12 +4,7 @@ import React, { useEffect, useRef, useCallback } from 'react' import { backgroundColor, zircon, primaryColor } from 'src/styling/variables' -const transactionProfit = tx => { - const fixedFee = tx.fixedFee ? Number.parseFloat(tx.fixedFee) : 0 - const commission = - Number.parseFloat(tx.commissionPercentage) * Number.parseFloat(tx.fiat) - return commission + fixedFee -} +const transactionProfit = R.prop('profit') const mockPoint = (tx, offsetMs, profit) => { const date = new Date(new Date(tx.created).getTime() + offsetMs).toISOString()