get all installtion list

master^2
Bhaskar 7 months ago
parent 148f586128
commit ddba664104

@ -134,6 +134,42 @@ exports.createTeamMember = async (request, reply) => {
});
}
};
exports.getAllInstallers = async (request, reply) => {
try {
const { departmentName } = request.params; // Get installationId from request params
// Check if installation exists
const installationList = await Deparments.find({ departmentName });
if (!installationList) {
return reply.status(404).send({
simplydata: {
error: true,
message: "Installation not found",
},
});
}
return reply.send({
simplydata: {
error: false,
installationList, // Return the list of team members
},
});
} catch (err) {
console.error("Error fetching team members:", err);
reply.status(500).send({
simplydata: {
error: true,
message: "Internal server error",
},
});
}
};
exports.editTeamMember = async (request, reply) => {
try {

@ -74,6 +74,25 @@ module.exports = function (fastify, opts, next) {
handler: installationController.getTeamMembers
});
fastify.get("/api/getAllInstallers/:departmentName", {
schema: {
description: "Get All Installtion list",
tags: ["Installation"],
summary: "Get All Installtion list",
params: {
type: "object",
properties: {
departmentName: {
type: "string",
description: "departmentName to fetch Installation list"
}
},
required: ["departmentName"]
},
},
handler: installationController.getAllInstallers
});
fastify.put("/api/editTeamMember/:installationId/:teamMemberId", {
schema: {
description: "Update an existing team member's details",

Loading…
Cancel
Save