From 1ae52c4723e64f60410ba2818496a5485e850ac1 Mon Sep 17 00:00:00 2001 From: varun Date: Wed, 26 Apr 2023 06:26:11 -0400 Subject: [PATCH] made changes in tanks --- src/controllers/tanksController.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index 91fb7be9..a794ba98 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -100,9 +100,10 @@ exports.updateTanksInfo = async (req, reply) => { //delete selected tank exports.deleteTanksInfo = async (req, reply) => { try { - var customerId = req.params.customerId; - var tankName = req.query.tankName; - const tank = await Tank.findOneAndDelete({ tankName: tankName,customerId:customerId,tankLocation:req.body.tankLocation.toLowerCase() }); + const customerId = req.params.customerId; + const tankName = req.query.tankName; + const tankLocation = req.body.tankLocation.toLowerCase(); + const tank = await Tank.findOneAndDelete({ tankName: tankName,customerId:customerId,tankLocation:tankLocation }); reply.send({ status_code: 200, data: tank}); // return tank;