From 4d790da73b34717e21c97baa255a817f932d0a4d Mon Sep 17 00:00:00 2001 From: varun Date: Wed, 8 Feb 2023 00:49:18 -0500 Subject: [PATCH] made changes in tanker controller --- src/controllers/tankersController.js | 2 +- src/routes/tankersRoute.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/controllers/tankersController.js b/src/controllers/tankersController.js index 9f56d5af..97b6f3a6 100644 --- a/src/controllers/tankersController.js +++ b/src/controllers/tankersController.js @@ -175,7 +175,7 @@ exports.addBores = async (req, reply) => { //const username = req.params.username; var customerId = req.params.customerId; - //console.log(req.params); + console.log(customerId); //const username = loginObject.user.username; //console.log(loginObject.user.username) // const userInfo = await User.findOne({ username: username.toString() }); diff --git a/src/routes/tankersRoute.js b/src/routes/tankersRoute.js index 394a1f85..d4a6d573 100644 --- a/src/routes/tankersRoute.js +++ b/src/routes/tankersRoute.js @@ -163,11 +163,21 @@ module.exports = function (fastify, opts, next) { fastify.route({ method: "POST", - url: "/api/addBores", + url: "/api/addBores/:customerId", schema: { tags: ["Supplier"], description: "This is to cretae New Bore", summary: "This is to Create New Bore.", + params: { + required: ["customerId"], + type: "object", + properties: { + customerId: { + type: "string", + description: "customerId", + }, + }, + }, body: { type: "object", properties: {