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

@ -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." });

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

Loading…
Cancel
Save