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;