fleetmap-reports 2.0.11 → 2.0.13

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": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -75,7 +75,7 @@ async function createActivityReportByGroup (from, to, userData, traccarInstance)
75
75
  return reportData
76
76
  }
77
77
 
78
- async function executeServerSide (allData, sliced, from, to, userData, totalDevices, axios) {
78
+ async function executeServerSide (allData, sliced, from, to, userData, totalDevices, {axios}) {
79
79
  let deviceCount = 0
80
80
  for (const devices of sliced) {
81
81
  const url = `https://${process.env.SERVER_HOST}/reports/activity-report`
@@ -16,7 +16,6 @@ const {
16
16
  newDomains
17
17
  } = require('fleetmap-partners')
18
18
  const { devicesToProcess } = require('./util/device')
19
- const axios = require('axios')
20
19
  const {
21
20
  filterPositions,
22
21
  cleanPositions
@@ -42,7 +41,7 @@ async function createZoneReport (from, to, userData, traccar) {
42
41
 
43
42
  if (isClientSide()) {
44
43
  const url = `https://${serverHost}/reports/zone-report/`
45
- return axios.post(url, { from, to, userData }, { withCredentials: true })
44
+ return traccar.axios.post(url, { from, to, userData }, { withCredentials: true })
46
45
  .then(d => d.data)
47
46
  }
48
47
  const types = ['geofenceEnter', 'geofenceExit']