diff options
author | Desmond Kyeremeh <elDekyfin@gmail.com> | 2021-07-11 22:14:39 +0000 |
---|---|---|
committer | Desmond Kyeremeh <elDekyfin@gmail.com> | 2021-07-11 22:14:39 +0000 |
commit | 1b93de84e2bf6a6532bdb03e1ae75e47061a4dca (patch) | |
tree | 8989ce8c6c5bb1d2a748ffe91895fe929c99dd5e /modern/src/reports/RouteReportPage.js | |
parent | efe18c504a834760242937572b369530c552e589 (diff) | |
download | trackermap-web-1b93de84e2bf6a6532bdb03e1ae75e47061a4dca.tar.gz trackermap-web-1b93de84e2bf6a6532bdb03e1ae75e47061a4dca.tar.bz2 trackermap-web-1b93de84e2bf6a6532bdb03e1ae75e47061a4dca.zip |
Fixed linting
Diffstat (limited to 'modern/src/reports/RouteReportPage.js')
-rw-r--r-- | modern/src/reports/RouteReportPage.js | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index c09d4f5c..fffcdcb5 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -1,17 +1,20 @@ import React, { useState } from 'react'; import { Paper } from '@material-ui/core'; import { DataGrid } from '@material-ui/data-grid'; -import { useTheme } from "@material-ui/core/styles"; -import { formatDistance, formatSpeed, formatBoolean, formatDate, formatCoordinate } from '../common/formatter'; +import { useTheme } from '@material-ui/core/styles'; +import { + formatDistance, formatSpeed, formatBoolean, formatDate, formatCoordinate, +} from '../common/formatter'; import ReportFilter from './ReportFilter'; import ReportLayout from './ReportLayout'; import { useAttributePreference, usePreference } from '../common/preferences'; import t from '../common/localization'; const Filter = ({ setItems }) => { - const handleSubmit = async (deviceId, from, to, mail, headers) => { - const query = new URLSearchParams({ deviceId, from, to, mail }); + const query = new URLSearchParams({ + deviceId, from, to, mail, + }); const response = await fetch(`/api/reports/route?${query.toString()}`, { headers }); if (response.ok) { const contentType = response.headers.get('content-type'); @@ -23,7 +26,7 @@ const Filter = ({ setItems }) => { } } } - } + }; return <ReportFilter handleSubmit={handleSubmit} />; }; @@ -78,7 +81,7 @@ const RouteReportPage = () => { width: theme.dimensions.columnWidthNumber, valueGetter: ({ row }) => row.attributes.totalDistance, valueFormatter: ({ value }) => formatDistance(value, distanceUnit), - }] + }]; const [items, setItems] = useState([]); @@ -86,10 +89,11 @@ const RouteReportPage = () => { <ReportLayout filter={<Filter setItems={setItems} />}> <Paper> <DataGrid - rows={items} - columns={columns} - hideFooter - autoHeight /> + rows={items} + columns={columns} + hideFooter + autoHeight + /> </Paper> </ReportLayout> ); |