diff --git a/src/controllers/installationController.js b/src/controllers/installationController.js index eaa6c179..b3d72e38 100644 --- a/src/controllers/installationController.js +++ b/src/controllers/installationController.js @@ -1621,7 +1621,8 @@ exports.getIotDataByCustomer = async (req, reply) => { ? "GSM is connected" : "GSM is not connected"; - const tanks = connectedSlaves.map(slave => { + // Map connected slaves to tank details + let tanks = connectedSlaves.map(slave => { const slaveId = slave.hardwareId?.trim(); const matchedTank = latestRecord.tanks.find(tank => tank.tankhardwareId === slaveId); @@ -1640,6 +1641,9 @@ exports.getIotDataByCustomer = async (req, reply) => { }; }); + // ❗ Remove the first tank entry + tanks = tanks.slice(1); + return { hardwareId, message,