|
|
@ -28,14 +28,15 @@ console.log(req.params);
|
|
|
|
tankersData = {
|
|
|
|
tankersData = {
|
|
|
|
supplierId:supplierId,
|
|
|
|
supplierId:supplierId,
|
|
|
|
|
|
|
|
|
|
|
|
supplier_name:req.body.username,
|
|
|
|
supplier_name:req.body.supplier_name,
|
|
|
|
supplier_address : req.body.supplier_address,
|
|
|
|
supplier_address : req.body.supplier_address,
|
|
|
|
tankerName: req.body.tankerName,
|
|
|
|
tankerName: req.body.tankerName,
|
|
|
|
phoneNumber: req.body.phoneNumber,
|
|
|
|
phoneNumber: req.body.phoneNumber,
|
|
|
|
alternative_phoneNumber: req.body.alternative_phoneNumber,
|
|
|
|
alternative_phoneNumber: req.body.alternative_phoneNumber,
|
|
|
|
typeofwater: req.body.typeofwater,
|
|
|
|
typeofwater: req.body.typeofwater,
|
|
|
|
capacity: req.body.capacity,
|
|
|
|
capacity: req.body.capacity,
|
|
|
|
price: req.body.price
|
|
|
|
price: req.body.price,
|
|
|
|
|
|
|
|
status: req.body.status
|
|
|
|
};
|
|
|
|
};
|
|
|
|
console.log(req.body.typeofwater,req.body.capacity)
|
|
|
|
console.log(req.body.typeofwater,req.body.capacity)
|
|
|
|
|
|
|
|
|
|
|
@ -61,6 +62,7 @@ console.log(req.params);
|
|
|
|
tankers.typeofwater = usertobeInserted.typeofwater;
|
|
|
|
tankers.typeofwater = usertobeInserted.typeofwater;
|
|
|
|
tankers.supplierId = usertobeInserted.supplierId;
|
|
|
|
tankers.supplierId = usertobeInserted.supplierId;
|
|
|
|
tankers.price = usertobeInserted.price;
|
|
|
|
tankers.price = usertobeInserted.price;
|
|
|
|
|
|
|
|
tankers.status = usertobeInserted.status;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const insertedTanker = await tankers.save();
|
|
|
|
const insertedTanker = await tankers.save();
|
|
|
@ -437,3 +439,26 @@ exports.updatePipelineInfo = async (req, reply) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.status = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
var status = req.query.status;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (status === 'connected') {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const tankers = await Tanker.find({});
|
|
|
|
|
|
|
|
console.log("tankers...", tankers)
|
|
|
|
|
|
|
|
reply.send(tankers);
|
|
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
|
|
reply.send({ message: err });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
reply.send({ message: 'Not Connected' });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (err) {
|
|
|
|
|
|
|
|
throw boom.boomify(err);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|