diff --git a/src/controllers/tankersController.js b/src/controllers/tankersController.js index 757bbc8f..54c1c2c0 100644 --- a/src/controllers/tankersController.js +++ b/src/controllers/tankersController.js @@ -78,7 +78,7 @@ console.log(req.params); -exports.addTankers1 = async (req, reply) => { +exports.deleteTankerInfo1 = async (req, reply) => { try { //const username = req.params.username; diff --git a/src/routes/tankersRoute.js b/src/routes/tankersRoute.js index 8ad0a899..b4ca6de0 100644 --- a/src/routes/tankersRoute.js +++ b/src/routes/tankersRoute.js @@ -168,6 +168,7 @@ module.exports = function (fastify, opts, next) { }); + fastify.route({ @@ -552,6 +553,36 @@ module.exports = function (fastify, opts, next) { }); + fastify.route({ + method: "PUT", + url: "/api/deleteTanker1/:supplierId", + schema: { + tags: ["Supplier"], + summary: "This is to delete tanker", + params: { + required: ["supplierId"], + type: "object", + properties: { + supplierId: { + type: "string", + description: "supplierId", + }, + }, + }, + querystring: { + tankerName: {type: 'string'} + }, + security: [ + { + basicAuth: [], + }, + ], + }, + preHandler: fastify.auth([fastify.authenticate]), + handler: tankersController.deleteTankerInfo1, + }); + + next();