aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-03-23 11:40:31 +0530
committerAshutosh Bishnoi <mail2bishnoi@gmail.com>2021-03-23 11:40:31 +0530
commitfb10eae09daf7e922ee5e2d94785d55b8b5f6b4b (patch)
treec53b686a68e7e82a7fb76327f3fc46212c6486d1
parent7bc6f83a8d10e7bbaf9b0a8ad92117668f9ff217 (diff)
downloadtrackermap-web-fb10eae09daf7e922ee5e2d94785d55b8b5f6b4b.tar.gz
trackermap-web-fb10eae09daf7e922ee5e2d94785d55b8b5f6b4b.tar.bz2
trackermap-web-fb10eae09daf7e922ee5e2d94785d55b8b5f6b4b.zip
More code refactoring
-rw-r--r--modern/src/reports/RouteReportPage.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js
index e556a0ba..1c13a132 100644
--- a/modern/src/reports/RouteReportPage.js
+++ b/modern/src/reports/RouteReportPage.js
@@ -64,14 +64,16 @@ const RouteReportPage = () => {
field: 'ignition',
type: 'boolean',
flex: 1,
- valueGetter: ({ getValue }) => getValue('attributes').ignition ? 'Yes' : 'No',
+ valueGetter: ({ row }) => row.attributes.ignition,
+ valueFormatter: ({ value }) => value ? 'Yes' : 'No',
}, {
headerName: t('deviceTotalDistance'),
field: 'totalDistance',
type: 'number',
hide: true,
flex: 1,
- valueGetter: ({ getValue }) => formatDistance(getValue('attributes').totalDistance, distanceUnit),
+ valueGetter: ({ row }) => row.attributes.totalDistance,
+ valueFormatter: ({ value }) => formatDistance(value, distanceUnit),
}]
const [items, setItems] = useState([]);