fleetmap-reports 2.0.79 → 2.0.80

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.79",
3
+ "version": "2.0.80",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -23,6 +23,7 @@ const {
23
23
  const { checkGeofenceIn } = require('./util/geofence')
24
24
  const { parallel } = require('./util/parallel')
25
25
  const { getDataByDay } = require('./util/trips')
26
+ const axios = require('axios')
26
27
  const sliceSize = 100
27
28
  const deviceChunk = 5
28
29
  const fileName = 'ZoneReport'
@@ -36,8 +37,9 @@ async function createZoneReport (from, to, userData, traccar) {
36
37
  }
37
38
 
38
39
  if (isClientSide()) {
39
- const url = `https://${getServerHost()}/reports/zone-report/`
40
- return traccar.axios.post(url, { from, to, userData }, { withCredentials: true })
40
+ const url = 'https://alb.fleetmap.pt/reports/zone-report/'
41
+ const cookie = await axios.get('/pinmeapi/cookie/get', { withCredentials: true }).then(d => d.data)
42
+ return traccar.axios.post(url, { from, to, userData }, { headers: {cookie} })
41
43
  .then(d => d.data)
42
44
  }
43
45
  const types = ['geofenceEnter', 'geofenceExit']