diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2020-11-05 17:04:13 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2020-11-05 17:04:13 +0530 |
commit | b217a08d311a7c21e88594894c01651c31cbf18e (patch) | |
tree | 06c41262aa486d87a81ebea2aef30631d9db7a0d /modern/src/reports/EventReportPage.js | |
parent | 3780cf9986947e409ffccd9e7a06d9554ce3cdcf (diff) | |
download | trackermap-web-b217a08d311a7c21e88594894c01651c31cbf18e.tar.gz trackermap-web-b217a08d311a7c21e88594894c01651c31cbf18e.tar.bz2 trackermap-web-b217a08d311a7c21e88594894c01651c31cbf18e.zip |
adding custome field to Report Filter on the basis of report type
Diffstat (limited to 'modern/src/reports/EventReportPage.js')
-rw-r--r-- | modern/src/reports/EventReportPage.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/reports/EventReportPage.js b/modern/src/reports/EventReportPage.js index fce9597f..6aaf4c55 100644 --- a/modern/src/reports/EventReportPage.js +++ b/modern/src/reports/EventReportPage.js @@ -25,13 +25,13 @@ const EventReportPage = () => { const classes = useStyles(); const [data, setData] = useState([]); - const handleSubmit = async (deviceId, from, to) => { + const handleSubmit = async (deviceId, from, to, type) => { const query = new URLSearchParams({ deviceId, from: from.toISOString(), to: to.toISOString(), }); - + type.map(t=>query.append('type',t)); const response = await fetch(`/api/reports/events?${query.toString()}`, { headers: { Accept: 'application/json' } }) if(response.ok) { @@ -47,7 +47,7 @@ const EventReportPage = () => { <Grid container spacing={2}> <Grid item xs={12} md={3} lg={2}> <Paper className={classes.form}> - <ReportFilter handleSubmit={handleSubmit} /> + <ReportFilter reportType='event' handleSubmit={handleSubmit} /> </Paper> </Grid> <Grid item xs={12} md={9} lg={10}> |