added field in tankschema,made changes in tank routes and tank controllers,updated connections

master
varun 3 years ago
parent bf223c5120
commit d6ec8e903b

@ -25,6 +25,7 @@ console.log(req.params);
blockName: req.body.blockName, blockName: req.body.blockName,
capacity: req.body.capacity, capacity: req.body.capacity,
typeOfWater: req.body.typeOfWater, typeOfWater: req.body.typeOfWater,
type: req.body.type,
tankLocation:req.body.tankLocation, tankLocation:req.body.tankLocation,
}; };
var tank_name = req.body.tankName var tank_name = req.body.tankName
@ -44,6 +45,7 @@ console.log(req.params);
tank.blockName = usertobeInserted.blockName; tank.blockName = usertobeInserted.blockName;
tank.capacity = usertobeInserted.capacity; tank.capacity = usertobeInserted.capacity;
tank.typeOfWater = usertobeInserted.typeOfWater; tank.typeOfWater = usertobeInserted.typeOfWater;
tank.typer = usertobeInserted.type;
tank.tankLocation = usertobeInserted.tankLocation; tank.tankLocation = usertobeInserted.tankLocation;
} }
} }

@ -15,6 +15,7 @@ const tanksSchema = new mongoose.Schema({
blockName: { type: String, default: null }, blockName: { type: String, default: null },
capacity: { type: String, default: null }, capacity: { type: String, default: null },
typeOfWater: { type: String, default: null }, typeOfWater: { type: String, default: null },
type: { type: String, default: null },
tankLocation: { type: String, default: null }, tankLocation: { type: String, default: null },

@ -17,6 +17,7 @@ module.exports = function (fastify, opts, next) {
blockName: { type: "string"}, blockName: { type: "string"},
capacity: { type: "string" }, capacity: { type: "string" },
typeOfWater: { type: "string" }, typeOfWater: { type: "string" },
type: { type: "string" },
tankLocation: { type: "string" }, tankLocation: { type: "string" },
}, },
}, },

Loading…
Cancel
Save