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 },