Bhaskar 10 months ago
commit 92573335ef

@ -110,13 +110,17 @@ exports.addTanks = async (req, reply) => {
customerId: customerId,
hardwareId: hardwareId,
tankhardwareId: tankhardwareId,
shape: req.body.shape,
tankName: req.body.tankName,
blockName: req.body.blockName,
capacity: req.body.capacity,
typeOfWater: req.body.typeOfWater,
tankLocation: req.body.tankLocation.toLowerCase(),
waterCapacityPerCm:req.body.waterCapacityPerCm,
height:req.body.height
height:req.body.height,
length:req.body.length,
width:req.body.width
// ... other fields
};

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

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

@ -33,7 +33,10 @@ module.exports = function (fastify, opts, next) {
typeOfWater: { type: "string" },
waterCapacityPerCm:{ type: "string" },
tankLocation: { type: "string" },
shape:{ type: "string" },
height:{ type: "string" },
width:{ type: "string" },
length:{ type: "string" },
},
},
security: [
@ -81,11 +84,14 @@ module.exports = function (fastify, opts, next) {
tankName: { type: "string" },
blockName: { type: "string"},
capacity: { type: "string" },
shape: { type: "string" },
// customerId: { type: "string" },
typeOfWater: { type: "string" },
waterCapacityPerCm:{ type: "string" },
tankLocation: { type: "string" },
height:{ type: "string" },
width:{ type: "string" },
length:{ type: "string" },
},
},
security: [

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

Loading…
Cancel
Save