motor action and added installerid in bore creation

master
varun 1 year ago
parent 9e9c1d4bf8
commit a2e0e0e8d8

@ -388,12 +388,13 @@ exports.addBores = async (req, reply) => {
try {
var customerId = req.params.customerId;
var InstallerId = req.params.InstallerId;
//console.log(customerId);
//const username = loginObject.user.username;
boresData = {
customerId:customerId,
InstallerId:InstallerId,
customerId:req.body.customerId,
boreName: req.body.boreName,
capacity: req.body.capacity,
typeofwater: req.body.typeofwater,
@ -414,6 +415,9 @@ exports.addBores = async (req, reply) => {
if (checkFormEncoding.isUserFormUrlEncoded) {
usertobeInserted = checkFormEncoding.bores;
console.log("thsi true url string");
bores.InstallerId = usertobeInserted.InstallerId
bores.customerId = usertobeInserted.customerId
bores.boreName = usertobeInserted.boreName;
bores.capacity = usertobeInserted.capacity;

@ -1097,7 +1097,7 @@ exports.motorAction = async (req, reply) => {
const newMotorData = new MotorData({
customerId: customerId,
motor_id: motor_id,
motor_id: motorId,
start_instance_id: start_instance_id,
supplierTank: req.body.from,
receiverTank: req.body.to,

@ -76,7 +76,7 @@ const tankersbookingSchema = new mongoose.Schema({
const boreSchema = new mongoose.Schema({
customerId: { type: String, default: null },
InstallerId: { type: String, default: null },
boreName: { type: String, default: null },
capacity: { type: String, default: null },
typeofwater: { type: String, default: null },

@ -269,18 +269,18 @@ module.exports = function (fastify, opts, next) {
fastify.route({
method: "POST",
url: "/api/addBores/:customerId",
url: "/api/addBores/:InstallerId",
schema: {
tags: ["Tank"],
description: "This is to cretae New Bore",
summary: "This is to Create New Bore.",
params: {
required: ["customerId"],
required: ["InstallerId"],
type: "object",
properties: {
customerId: {
InstallerId: {
type: "string",
description: "customerId",
description: "InstallerId",
},
},
},
@ -288,6 +288,7 @@ module.exports = function (fastify, opts, next) {
type: "object",
properties: {
boreName: { type: "string" },
customerId: { type: "string" },
capacity: { type: "string" },
typeofwater: { type: "string" },
description: { type: "string" },

Loading…
Cancel
Save