const fastify = require("fastify"); const tanksController = require("../controllers/tanksController"); module.exports = function (fastify, opts, next) { fastify.route({ method: "POST", url: "/api/addTanks", schema: { tags: ["Tank"], description: "This is for cretae New Tank", summary: "This is for Create New Tank.", body: { type: "object", properties: { tankName: { type: "string", default: null }, blockName: { type: "string", default: null }, capacity: { type: "number" }, typeOfWater: { type: "string", default: null }, tankLocation: { type: "string", default: null }, }, }, security: [ { basicAuth: [], }, ], }, preHandler: fastify.auth([fastify.authenticate]), handler: tanksController.addTanks, // onResponse: (request, reply) => { // validationHandler.sendPhoneVerificationCode(request, reply); // }, //onResponse: validationHandler.sendPhoneVerificationCode, }); next(); }