DELETE api for bookingid

master
Bhaskara Kishore 3 years ago
parent 88babe0d4c
commit 7eb2d40b86

@ -634,3 +634,17 @@ exports.connectstatus = async (req, reply) => {
//delete selected bookingid
exports.deleteBookingInfo = async (req, reply) => {
try {
var bookingid = req.params.bookingid;
const booking = await Tankerbooking.findOneAndDelete({ bookingid:bookingid });
reply.send({ status_code: 200, data: booking});
// return tank;
} catch (err) {
throw boom.boomify(err);
}
};

@ -700,6 +700,35 @@ module.exports = function (fastify, opts, next) {
handler: tankersController.getAllTankersaccepted, handler: tankersController.getAllTankersaccepted,
}); });
fastify.route({
method: "PUT",
url: "/api/deleteBookingInfo/:bookingid",
schema: {
tags: ["Supplier-Order"],
summary: "This is for delete Booking Info",
params: {
required: ["bookingid"],
type: "object",
properties: {
bookingid: {
type: "string",
description: "bookingid",
},
},
},
security: [
{
basicAuth: [],
},
],
},
preHandler: fastify.auth([fastify.authenticate]),
handler: tankersController.deleteBookingInfo,
});
next(); next();
} }

Loading…
Cancel
Save