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: {