From 3ade6d55855e3009e15311c49472511d82e81c1c Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Thu, 27 Mar 2025 12:55:11 +0530 Subject: [PATCH] changes --- src/controllers/tanksController.js | 2 +- src/routes/tanksRoute.js | 33 ++++++++++++++---------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/controllers/tanksController.js b/src/controllers/tanksController.js index b1911fe7..84b105a3 100644 --- a/src/controllers/tanksController.js +++ b/src/controllers/tanksController.js @@ -7467,7 +7467,7 @@ exports.adjustMeasurement = async (req, reply) => { exports.validateTankHeight = async (req, reply) => { try { - const { tankhardwareId, hardwareId } = req.body; + const { hardwareId, tankhardwareId } = req.params; if (!tankhardwareId || !hardwareId) { return reply.status(400).send({ message: "Both tankhardwareId and hardwareId are required." }); diff --git a/src/routes/tanksRoute.js b/src/routes/tanksRoute.js index 0855cb76..1ad46b57 100644 --- a/src/routes/tanksRoute.js +++ b/src/routes/tanksRoute.js @@ -566,25 +566,22 @@ module.exports = function (fastify, opts, next) { }); fastify.route({ - method: "POST", - url: "/api/validateRange", - schema: { - tags: ["Tank"], - description: "Validate tank height range", - summary: "Validate tank height range", - body: { - type: "object", - properties: { - tankhardwareId: { type: "string" }, - hardwareId: { type: "string" } - - - }, - required: ["tankhardwareId"] + method: "GET", + url: "/api/validateRange/:hardwareId/:tankhardwareId", + schema: { + tags: ["Tank"], + description: "Validate tank height range", + summary: "Validate tank height range", + params: { + type: "object", + properties: { + hardwareId: { type: "string" }, + tankhardwareId: { type: "string" } + }, + required: ["hardwareId", "tankhardwareId"] + } }, - - }, - handler: tanksController.validateTankHeight + handler: tanksController.validateTankHeight }); fastify.route({