|
|
@ -1342,6 +1342,9 @@ exports.IotDevice = async (req, reply) => {
|
|
|
|
// Update waterlevel in tanksSchema for each tank
|
|
|
|
// Update waterlevel in tanksSchema for each tank
|
|
|
|
for (const tank of tanks) {
|
|
|
|
for (const tank of tanks) {
|
|
|
|
const { tankhardwareId, tankHeight } = tank;
|
|
|
|
const { tankhardwareId, tankHeight } = tank;
|
|
|
|
|
|
|
|
if (!existingTank) {
|
|
|
|
|
|
|
|
continue; // Skip the rest of the loop body and move to the next iteration
|
|
|
|
|
|
|
|
}
|
|
|
|
// console.log(tankhardwareId)
|
|
|
|
// console.log(tankhardwareId)
|
|
|
|
// Find the corresponding tank in tanksSchema
|
|
|
|
// Find the corresponding tank in tanksSchema
|
|
|
|
const existingTank = await Tank.findOne({ hardwareId, tankhardwareId });
|
|
|
|
const existingTank = await Tank.findOne({ hardwareId, tankhardwareId });
|
|
|
|