fleetmap-reports 1.0.803 → 1.0.804

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.803",
3
+ "version": "1.0.804",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -51,16 +51,16 @@ async function createActivityReportByGroup (from, to, userData, traccarInstance)
51
51
  }
52
52
 
53
53
  const response = await traccarInstance.reports.reportsSummaryGet(from, to, null, [g.id])
54
- const summaries = response.data
54
+ const summary = response.data
55
55
 
56
56
  const responseTrips = await traccarInstance.reports.reportsTripsGet(from, to, null, [g.id])
57
57
  const trips = responseTrips.data
58
58
 
59
59
  devices.sort((a, b) => (a.name > b.name) ? 1 : -1)
60
60
 
61
- if (summaries.length > 0) {
62
- console.log('Summary:' + summaries.length)
63
- groupData.devices = processDevices(from, to, devices, { summaries, trips }, userData)
61
+ if (summary.length > 0) {
62
+ console.log('Summary:' + summary.length)
63
+ groupData.devices = processDevices(from, to, devices, { summary, trips }, userData)
64
64
 
65
65
  reportData.push(groupData)
66
66
  }
@@ -224,7 +224,7 @@ function processDevices (from, to, devices, data, userData) {
224
224
  endAddress: trips.length && trips[trips.length - 1].endAddress
225
225
  })
226
226
  } else {
227
- summary.push(...data.summaries.filter(s => s.deviceId === d.id))
227
+ summary.push(...data.summary.filter(s => s.deviceId === d.id))
228
228
 
229
229
  if (summary.length) {
230
230
  summary.forEach(s => {