master^2
Bhaskar 8 months ago
parent d5da6fbbee
commit dcd7a998f8

@ -1621,7 +1621,8 @@ exports.getIotDataByCustomer = async (req, reply) => {
? "GSM is connected" ? "GSM is connected"
: "GSM is not 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 slaveId = slave.hardwareId?.trim();
const matchedTank = latestRecord.tanks.find(tank => tank.tankhardwareId === slaveId); 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 { return {
hardwareId, hardwareId,
message, message,

Loading…
Cancel
Save