changes in getting active delivery boys

master
varun 3 years ago
parent 2383d245d2
commit e71b3d7eba

@ -9,8 +9,6 @@ const fastify = require("fastify")({
const { Tanker, Tankerbooking,Bore,GovtPipeLine } = require('../models/tankers') const { Tanker, Tankerbooking,Bore,GovtPipeLine } = require('../models/tankers')
exports.orderNow = async (req, reply) => { exports.orderNow = async (req, reply) => {
try { try {
@ -33,7 +31,6 @@ exports.orderNow = async (req, reply) => {
booking_info.delivery_agent_alternative_mobile = agent_alternative_mobile booking_info.delivery_agent_alternative_mobile = agent_alternative_mobile
booking_info.price = price booking_info.price = price
} }
else { else {
booking_info.orderStatus = "rejected" booking_info.orderStatus = "rejected"
@ -61,8 +58,6 @@ exports.orderNow = async (req, reply) => {
// const userInfo = await User.findOne({ username: username.toString() }); // const userInfo = await User.findOne({ username: username.toString() });
// const updateData = req.body; // const updateData = req.body;
// console.log("This is the reply in the handler after the validations", reply); // console.log("This is the reply in the handler after the validations", reply);
deliveryData = { deliveryData = {
supplierId: supplierId, supplierId: supplierId,
@ -73,7 +68,7 @@ exports.orderNow = async (req, reply) => {
city:req.body.city, city:req.body.city,
state:req.body.state, state:req.body.state,
zip:req.body.zip, zip:req.body.zip,
status:req.body.status,
}; };
var agent_mobile = req.body.phone var agent_mobile = req.body.phone
@ -98,6 +93,7 @@ exports.orderNow = async (req, reply) => {
agent.city = usertobeInserted.city agent.city = usertobeInserted.city
agent.state = usertobeInserted.state agent.state = usertobeInserted.state
agent.zip = usertobeInserted.zip agent.zip = usertobeInserted.zip
agent.status = usertobeInserted.status
} }
} }

@ -87,6 +87,7 @@ module.exports = function (fastify, opts, next) {
status: { type: "string" }, status: { type: "string" },
}, },
}, },
security: [ security: [
{ {

Loading…
Cancel
Save