email added in city chnages

master^2
Bhaskar 8 months ago
parent 4e122b0246
commit aed062e573

@ -67,6 +67,7 @@ const generateDepartmentId = async (city, departmentName) => {
pincode,
createdBy,
updatedBy,
email
} = request.body;
// Generate departmentId based on departmentName
@ -92,6 +93,7 @@ const generateDepartmentId = async (city, departmentName) => {
zone,
country,
pincode,
email,
// departmentName,
createdBy,
updatedBy,
@ -202,6 +204,7 @@ const generateDepartmentId = async (city, departmentName) => {
address1,
address2,
pincode,
email
// departmentName
} = request.body;
@ -228,7 +231,8 @@ const generateDepartmentId = async (city, departmentName) => {
existing.address1 = address1 || existing.address1;
existing.address2 = address2 || existing.address2;
existing.email = email || existing.email;
await existing.save();

@ -11,6 +11,7 @@ const citySchema = new mongoose.Schema(
phone: { type: String, unique: true, trim: true },
office_address1: String,
officeName: { type: String },
email: { type: String },
address2: String,
pincode: { type: String },
zone: { type: String },

@ -20,6 +20,7 @@ module.exports = function (fastify, opts, next) {
items: { type: "string" },
},
state: { type: "string" },
email: { type: "string" },
country: { type: "string" },
office_address1: { type: "string" },
address2: { type: "string" },
@ -144,6 +145,7 @@ module.exports = function (fastify, opts, next) {
zone: { type: "string" },
pincode: { type: "string" },
departmentName: { type: "string" },
email: { type: "string" },
},
}

Loading…
Cancel
Save