diff --git a/client/src/App.js b/client/src/App.js index 7ef951b..1acc1e7 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -679,10 +679,10 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura try { const api_key = localStorage.getItem('api_key', 'null'); const params = { end: end.unix(), duration: duration.len.toLowerCase(), window: duration.win, api_key: api_key }; - + const names = sensors.join(','); const res = await axios.get(`https://sensors-api.dns.t0.vc/history/${measurement}/${names}`, { params }); - + const formattedData = res.data.map(d => { const newObj = { time: d.time }; sensors.forEach(sensor => { @@ -690,7 +690,7 @@ function MultiLineChart({title, measurement, dataKey, sensors, colors, end, dura }); return newObj; }); - + setData(formattedData); setLoading(false); } catch (error) { diff --git a/main.py b/main.py index 602be59..9957dd4 100644 --- a/main.py +++ b/main.py @@ -556,12 +556,12 @@ async def history(request): q += ' tz(\'America/Edmonton\')' points = list(client.query(q).get_points()) - + for p in points: t = p['time'] if t not in time_map: time_map[t] = {'time': t} - + if len(names) > 1: for k, v in p.items(): if k != 'time':