diff --git a/controllers/logs.js b/controllers/logs.js index 6046c84..d4009ea 100644 --- a/controllers/logs.js +++ b/controllers/logs.js @@ -11,7 +11,7 @@ const submitToLatestLog = asyncHandler(async (req, res, next) => { const telemetryObj = req.body.telemetry || {}; const baseData = { akey: req.headers.akey, - charge: telemetryObj.charging, + charge: parseInt(telemetryObj.charging) || 0, startSOC: telemetryObj.soc_display || telemetryObj.soc_bms, startODO: telemetryObj.odo, startCEC: telemetryObj.cumulative_energy_charged,