From ec8fed96e394ff252c7e98bed1ca2e5322ad650a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 14 Nov 2020 16:13:58 -0800 Subject: More cleanup --- modern/src/reports/RouteReportPage.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'modern/src/reports/RouteReportPage.js') diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index 0f8d98a..d2a1b68 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -8,21 +8,18 @@ import ReportLayoutPage from './ReportLayoutPage'; const ReportFilterForm = ({ onResult }) => { const handleSubmit = async (deviceId, from, to) => { - const query = new URLSearchParams({ - deviceId, - from: from.toISOString(), - to: to.toISOString(), - }); + const query = new URLSearchParams({ deviceId, from, to }); const response = await fetch(`/api/reports/route?${query.toString()}`, { headers: { Accept: 'application/json' } }); if(response.ok) { onResult(await response.json()); } } return ; -} +}; const RouteReportPage = () => { const [items, setItems] = useState([]); + return ( @@ -51,6 +48,6 @@ const RouteReportPage = () => { ); -} +}; export default RouteReportPage; -- cgit v1.2.3