|
|
|
@ -2,29 +2,30 @@ const departmentController = require('../controllers/departmentController')
|
|
|
|
|
|
|
|
|
|
module.exports = function (fastify, opts, next) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.route({
|
|
|
|
|
method: "POST",
|
|
|
|
|
url: "/api/departmentSignup",
|
|
|
|
|
schema: {
|
|
|
|
|
tags: ["Department"],
|
|
|
|
|
description: "This is for creating a new Department Account",
|
|
|
|
|
summary: "This is for creating a new Department Account",
|
|
|
|
|
description: "This is for creating a new department account",
|
|
|
|
|
summary: "This is for creating a new department account",
|
|
|
|
|
body: {
|
|
|
|
|
type: "object",
|
|
|
|
|
//required: ["phone", "username", "password", "role"], // Add role to required fields
|
|
|
|
|
properties: {
|
|
|
|
|
// phone: { type: "string" },
|
|
|
|
|
// password: { type: "string" },
|
|
|
|
|
phone: { type: "string" },
|
|
|
|
|
city: { type: "string" },
|
|
|
|
|
officeName: { type: "string" },
|
|
|
|
|
location: {
|
|
|
|
|
type: "array",
|
|
|
|
|
items: { type: "string" },
|
|
|
|
|
},
|
|
|
|
|
state: { type: "string" },
|
|
|
|
|
country: { type: "string" },
|
|
|
|
|
address1: { type: "string" },
|
|
|
|
|
office_address1: { type: "string" },
|
|
|
|
|
address2: { type: "string" },
|
|
|
|
|
zone: { type: "string" },
|
|
|
|
|
pincode: { type: "string" },
|
|
|
|
|
departmentName: { type: "string" },
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
security: [
|
|
|
|
@ -36,6 +37,7 @@ module.exports = function (fastify, opts, next) {
|
|
|
|
|
handler: departmentController.addDepartment,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fastify.get("/api/getSingledepartmentData/:departmentId", {
|
|
|
|
|
schema: {
|
|
|
|
|
tags: ["Department"],
|
|
|
|
|