You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
3 years ago
|
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();
|
||
|
}
|
||
|
|
||
|
|