change in iot

master
varun 1 year ago
parent 83dc299980
commit 7c6e6c746d

@ -1405,7 +1405,10 @@ exports.IotDevice1 = async (req, reply) => {
// Update waterlevel in tanksSchema for each tank
for (const tank of tanks) {
const { tankhardwareId, tankHeight } = tank;
if (tankHeight === null || tankHeight === undefined) {
continue; // Skip this iteration and move to the next tank
}
// Find the corresponding tank in tanksSchema
const existingTank = await Tank.findOne({ hardwareId, tankhardwareId });

Loading…
Cancel
Save