@ -110,10 +110,10 @@ exports.tankerBooking = async (req, reply) => {
const bookingId = `ARM${year}${month}${day}${count}`
bookingCount = (bookingCount + 1) % 100;
var booking_id = await Tankerbooking.findOne({ bookingid: bookingId})
if(booking_id){
reply.redirect(tankerBooking())
}
else {
// if(booking_id){
// reply.redirect(tankerBooking())
// }
// else {
bookingsData = {
bookingid : bookingId,
@ -138,7 +138,7 @@ exports.tankerBooking = async (req, reply) => {
//}
const booking_data = await tankersBookingData.save();
@ -20,7 +20,7 @@ const tankersSchema = new mongoose.Schema({
const tankersbookingSchema = new mongoose.Schema({
bookingid: { type: String, default: null },
bookingid: { type: String, default: null,unique: true },
typeofwater: { type: String, default: null },
capacity: { type: String, default: null },
address: { type: String, default: null },