added length and width in add and edit tanks,added bulding name for edit in edit user

master
Varun 10 months ago
parent 4aca575e86
commit 223bbdea42

@ -116,7 +116,10 @@ exports.addTanks = async (req, reply) => {
typeOfWater: req.body.typeOfWater, typeOfWater: req.body.typeOfWater,
tankLocation: req.body.tankLocation.toLowerCase(), tankLocation: req.body.tankLocation.toLowerCase(),
waterCapacityPerCm:req.body.waterCapacityPerCm, waterCapacityPerCm:req.body.waterCapacityPerCm,
height:req.body.height height:req.body.height,
length:req.body.length,
width:req.body.width
// ... other fields // ... other fields
}; };

@ -109,7 +109,7 @@ exports.editCuurentUserInfo = async (req, reply) => {
const { customerId } = req.params; const { customerId } = req.params;
const userInfo = await User.findOne({ customerId: customerId.toString() }); const userInfo = await User.findOne({ customerId: customerId.toString() });
const updateData = req.body; const updateData = req.body;
if (updateData.buildingName) userInfo.buildingName = updateData.buildingName
if (updateData.firstName) userInfo.profile.firstName = updateData.firstName; if (updateData.firstName) userInfo.profile.firstName = updateData.firstName;
if (updateData.lastName) userInfo.profile.lastName = updateData.lastName; if (updateData.lastName) userInfo.profile.lastName = updateData.lastName;
if (updateData.username) userInfo.username = updateData.username; if (updateData.username) userInfo.username = updateData.username;

@ -42,6 +42,8 @@ const tanksSchema = new mongoose.Schema({
blockName: { type: String, default: null }, blockName: { type: String, default: null },
capacity: { type: String, default: "0" }, capacity: { type: String, default: "0" },
height: { type: String, default: "0" }, height: { type: String, default: "0" },
length: { type: String, default: "0" },
width: { type: String, default: "0" },
tankLocation: { type: String, default: null }, tankLocation: { type: String, default: null },
waterCapacityPerCm: { type: String, default: "0" }, waterCapacityPerCm: { type: String, default: "0" },
typeOfWater: { type: String, default: null }, typeOfWater: { type: String, default: null },

@ -34,6 +34,8 @@ module.exports = function (fastify, opts, next) {
waterCapacityPerCm:{ type: "string" }, waterCapacityPerCm:{ type: "string" },
tankLocation: { type: "string" }, tankLocation: { type: "string" },
height:{ type: "string" }, height:{ type: "string" },
width:{ type: "string" },
length:{ type: "string" },
}, },
}, },
security: [ security: [
@ -86,6 +88,8 @@ module.exports = function (fastify, opts, next) {
waterCapacityPerCm:{ type: "string" }, waterCapacityPerCm:{ type: "string" },
tankLocation: { type: "string" }, tankLocation: { type: "string" },
height:{ type: "string" }, height:{ type: "string" },
width:{ type: "string" },
length:{ type: "string" },
}, },
}, },
security: [ security: [

@ -417,6 +417,7 @@ module.exports = function (fastify, opts, next) {
properties: { properties: {
phone: { type: "string" }, phone: { type: "string" },
firstName: { type: "string" }, firstName: { type: "string" },
buildingName: { type: "string" },
lastName: { type: "string" }, lastName: { type: "string" },
username: { type: "string" }, username: { type: "string" },
emails: { emails: {

Loading…
Cancel
Save