master^2
Bhaskar 6 months ago
parent 11e76a6d82
commit 3ade6d5585

@ -7467,7 +7467,7 @@ exports.adjustMeasurement = async (req, reply) => {
exports.validateTankHeight = async (req, reply) => { exports.validateTankHeight = async (req, reply) => {
try { try {
const { tankhardwareId, hardwareId } = req.body; const { hardwareId, tankhardwareId } = req.params;
if (!tankhardwareId || !hardwareId) { if (!tankhardwareId || !hardwareId) {
return reply.status(400).send({ message: "Both tankhardwareId and hardwareId are required." }); return reply.status(400).send({ message: "Both tankhardwareId and hardwareId are required." });

@ -566,25 +566,22 @@ module.exports = function (fastify, opts, next) {
}); });
fastify.route({ fastify.route({
method: "POST", method: "GET",
url: "/api/validateRange", url: "/api/validateRange/:hardwareId/:tankhardwareId",
schema: { schema: {
tags: ["Tank"], tags: ["Tank"],
description: "Validate tank height range", description: "Validate tank height range",
summary: "Validate tank height range", summary: "Validate tank height range",
body: { params: {
type: "object", type: "object",
properties: { properties: {
tankhardwareId: { type: "string" }, hardwareId: { type: "string" },
hardwareId: { type: "string" } tankhardwareId: { type: "string" }
},
required: ["hardwareId", "tankhardwareId"]
}, }
required: ["tankhardwareId"]
}, },
handler: tanksController.validateTankHeight
},
handler: tanksController.validateTankHeight
}); });
fastify.route({ fastify.route({

Loading…
Cancel
Save