fleetmap-reports 1.0.695 → 1.0.698

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/lang/frFR.json CHANGED
@@ -157,6 +157,8 @@
157
157
  "delete_geofence": "Éteindre"
158
158
  },
159
159
  "report": {
160
+ "distanceIn": "Kms à l'intérieur",
161
+ "distanceOut": "Kms à l'extérieur",
160
162
  "period": "Période",
161
163
  "closed": "Porte fermée",
162
164
  "opened": "Porte ouverte",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.695",
3
+ "version": "1.0.698",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -30,10 +30,14 @@ async function createZoneReport (from, to, userData, traccar) {
30
30
  if (processServerSide(userData)) {
31
31
  const url = `https://${process.env.SERVER_HOST}/reports/zone-report`
32
32
  const sliced = automaticReports.sliceArray(devices, sliceSize)
33
+ const promises = []
33
34
  for (const slice of sliced) {
34
- const data = await axios.post(url, { from, to, userData: { ...userData, devices: slice } }, { withCredentials: true }).then(d => d.data)
35
- allData.devices.push(...(data[0].devices))
35
+ promises.push(axios.post(url, { from, to, userData: { ...userData, devices: slice } }, { withCredentials: true })
36
+ .then(d => d.data)
37
+ .then(data => allData.devices.push(...(data[0].devices)))
38
+ )
36
39
  }
40
+ await Promise.all(promises)
37
41
  reportData.push(allData)
38
42
  return reportData
39
43
  }