From dcd7a998f8cbd144fd7f9b67b165686e1e73614e Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Wed, 16 Apr 2025 19:07:43 +0530 Subject: [PATCH] changes --- src/controllers/installationController.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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,