|
|
|
@ -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 {
|
|
|
|
|