|
|
@ -434,7 +434,19 @@ exports.addDepartment = async (request, reply) => {
|
|
|
|
let finalReportingManagerEmail = reportingManager_email;
|
|
|
|
let finalReportingManagerEmail = reportingManager_email;
|
|
|
|
|
|
|
|
|
|
|
|
if (reportingManager?.toLowerCase() === "self") {
|
|
|
|
if (reportingManager?.toLowerCase() === "self") {
|
|
|
|
finalReportingManager = `${firstName || ""} ${lastName || ""} - (${phone}) - ${city}`;
|
|
|
|
// Default format
|
|
|
|
|
|
|
|
let managerString = `${firstName || ""} ${lastName || ""} - (${phone}) - ${city}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If departmentName is "Head Office" or "Branch Office" → add departmentName
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
["head office", "branch office"].includes(
|
|
|
|
|
|
|
|
(departmentName || "").toLowerCase().trim()
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
managerString += ` - ${departmentName}`;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
finalReportingManager = managerString;
|
|
|
|
finalReportingManagerMobile = phone;
|
|
|
|
finalReportingManagerMobile = phone;
|
|
|
|
finalReportingManagerEmail = email;
|
|
|
|
finalReportingManagerEmail = email;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -482,6 +494,7 @@ exports.addDepartment = async (request, reply) => {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.getDetails = async (request, reply) => {
|
|
|
|
exports.getDetails = async (request, reply) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const { id } = request.params;
|
|
|
|
const { id } = request.params;
|
|
|
|