From 318dffff18a6d0d1d8f5dd30418b24dcba6754b7 Mon Sep 17 00:00:00 2001 From: Bhaskar Date: Fri, 3 Jan 2025 15:53:20 +0530 Subject: [PATCH] designation creation --- src/controllers/departmentController.js | 2 ++ src/models/Department.js | 1 + src/routes/departmentRoute.js | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/controllers/departmentController.js b/src/controllers/departmentController.js index c360464a..d36e60bd 100644 --- a/src/controllers/departmentController.js +++ b/src/controllers/departmentController.js @@ -236,6 +236,7 @@ exports.getAllDepartmentsParticularFields = async (req, reply) => { address2, pincode, desginationName, + location, createdBy, updatedBy, } = request.body; @@ -271,6 +272,7 @@ exports.getAllDepartmentsParticularFields = async (req, reply) => { country, pincode, desginationName, + location, createdBy, updatedBy, }); diff --git a/src/models/Department.js b/src/models/Department.js index bbc11383..8adfabb2 100644 --- a/src/models/Department.js +++ b/src/models/Department.js @@ -44,6 +44,7 @@ const departmentSchema = new mongoose.Schema( desginationName: { type: String }, phone: { type: String, unique: true, trim: true }, reportingManager : { type: String }, + location: [{ type : String}], firstName : { type: String }, lastName: { type: String }, email: { type: String }, diff --git a/src/routes/departmentRoute.js b/src/routes/departmentRoute.js index fbca1e0e..4864c73f 100644 --- a/src/routes/departmentRoute.js +++ b/src/routes/departmentRoute.js @@ -25,7 +25,7 @@ module.exports = function (fastify, opts, next) { address2: { type: "string" }, zone: { type: "string" }, pincode: { type: "string" }, - departmentName: { type: "string" }, + //departmentName: { type: "string" }, }, }, security: [ @@ -178,6 +178,10 @@ module.exports = function (fastify, opts, next) { lastName: { type: "string" }, reportingManager: { type: "string" }, email: { type: "string" }, + location: { + type: "array", + items: { type: "string" }, + }, }, }, security: [