diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index decfd3c6..d5ac310c 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -6455,21 +6455,21 @@ exports.updatetankstatus = async (req, reply) => { -exports.listofactiveandinactivetankstatus = async (req, reply) => { - try { - const { customerId } = req.params; - const status = req.query.status.toLowerCase(); +// exports.listofactiveandinactivetankstatus = async (req, reply) => { +// try { +// const { customerId } = req.params; +// const status = req.query.status.toLowerCase(); - if (!["active", "inactive"].includes(status)) { - return reply.code(400).send({ message: "Invalid status value" }); - } +// if (!["active", "inactive"].includes(status)) { +// return reply.code(400).send({ message: "Invalid status value" }); +// } - // Find tanks based on customerId and status - const tanks = await Tank.find({ customerId, status }); +// // Find tanks based on customerId and status +// const tanks = await Tank.find({ customerId, status }); - return reply.send({ tanks }); - } catch (error) { - console.error("Error fetching tank list:", error); - return reply.code(500).send({ message: "Internal Server Error" }); - } -}; +// return reply.send({ tanks }); +// } catch (error) { +// console.error("Error fetching tank list:", error); +// return reply.code(500).send({ message: "Internal Server Error" }); +// } +// }; diff --git a/src/routes/tanksRoute.js b/src/routes/tanksRoute.js index 5a6bca9d..189afd65 100644 --- a/src/routes/tanksRoute.js +++ b/src/routes/tanksRoute.js @@ -1270,29 +1270,29 @@ module.exports = function (fastify, opts, next) { }); - fastify.route({ - method: "GET", - url: "/api/listofactiveandinactivetankstatus/:customerId", - schema: { - tags: ["Tank"], - summary: "Get list of active or inactive tanks", - params: { - required: ["customerId"], - type: "object", - properties: { - customerId: { type: "string", description: "Customer ID" }, - }, - }, - querystring: { - type: "object", - properties: { - status: { type: "string"}, - }, - }, - security: [{ basicAuth: [] }], - }, - handler: tanksController.listofactiveandinactivetankstatus, - }); + // fastify.route({ + // method: "GET", + // url: "/api/listofactiveandinactivetankstatus/:customerId", + // schema: { + // tags: ["Tank"], + // summary: "Get list of active or inactive tanks", + // params: { + // required: ["customerId"], + // type: "object", + // properties: { + // customerId: { type: "string", description: "Customer ID" }, + // }, + // }, + // querystring: { + // type: "object", + // properties: { + // status: { type: "string"}, + // }, + // }, + // security: [{ basicAuth: [] }], + // }, + // handler: tanksController.listofactiveandinactivetankstatus, + // }); next();