From b6225d24fb484abbf4e9abf3a55942521a6171b1 Mon Sep 17 00:00:00 2001 From: Varun Date: Mon, 17 Mar 2025 12:15:14 +0530 Subject: [PATCH] changes --- src/controllers/tanksController.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 1c5e6b2a..f1baa6f3 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -2871,18 +2871,7 @@ exports.motorAction = async (req, reply) => { const startTime = moment().tz('Asia/Kolkata').format('DD-MMM-YYYY - HH:mm'); - const newMotorData = new MotorData({ - customerId, - motor_id: motorId, - start_instance_id, - supplierTank: req.body.from, - receiverTank: req.body.to, - supplier_type: req.body.from_type, - receiver_type: req.body.to_type, - startTime, - receiverInitialwaterlevel: parseInt(receiverTank.waterlevel.replace(/,/g, ''), 10) - }); - await newMotorData.save(); + await Tank.updateOne( { customerId, "connections.inputConnections.motor_id": motorId },