|
|
@ -7435,7 +7435,7 @@ exports.particularCategory = async (req, reply) => {
|
|
|
|
if (!support) {
|
|
|
|
if (!support) {
|
|
|
|
return reply.code(404).send({ message: "Support record not found" });
|
|
|
|
return reply.code(404).send({ message: "Support record not found" });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log("support",support)
|
|
|
|
|
|
|
|
// Choose the appropriate array based on category
|
|
|
|
// Choose the appropriate array based on category
|
|
|
|
let issues = [];
|
|
|
|
let issues = [];
|
|
|
|
if (category === "Resolved") {
|
|
|
|
if (category === "Resolved") {
|
|
|
@ -7443,7 +7443,7 @@ exports.particularCategory = async (req, reply) => {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
issues = (support.categorizedIssues || []).filter(issue => issue.category === category);
|
|
|
|
issues = (support.categorizedIssues || []).filter(issue => issue.category === category);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
console.log("issues",issues)
|
|
|
|
|
|
|
|
if (issues.length === 0) {
|
|
|
|
if (issues.length === 0) {
|
|
|
|
return reply.code(404).send({ message: `No issues found for category: ${category}` });
|
|
|
|
return reply.code(404).send({ message: `No issues found for category: ${category}` });
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -7489,7 +7489,9 @@ exports.particularCategory = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
|
|
const disconnectedIssues = [];
|
|
|
|
const disconnectedIssues = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (const master of allRelatedSensors.filter(i => i.type === "master")) {
|
|
|
|
const allMasters = allRelatedSensors.filter(i => i.type === "master");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (const master of allMasters) {
|
|
|
|
const slaves = await Insensors.find({
|
|
|
|
const slaves = await Insensors.find({
|
|
|
|
connected_to: master.hardwareId,
|
|
|
|
connected_to: master.hardwareId,
|
|
|
|
customerId
|
|
|
|
customerId
|
|
|
@ -7548,7 +7550,10 @@ exports.particularCategory = async (req, reply) => {
|
|
|
|
team_member_support_gsm_last_check_time: master.team_member_support_gsm_last_check_time || null,
|
|
|
|
team_member_support_gsm_last_check_time: master.team_member_support_gsm_last_check_time || null,
|
|
|
|
connected_slave_count: slaveDetails.length,
|
|
|
|
connected_slave_count: slaveDetails.length,
|
|
|
|
connected_slaves: slaveDetails,
|
|
|
|
connected_slaves: slaveDetails,
|
|
|
|
comments: masterComments
|
|
|
|
comments: masterComments,
|
|
|
|
|
|
|
|
isDisconnected:
|
|
|
|
|
|
|
|
master.connected_status === "disconnected" ||
|
|
|
|
|
|
|
|
slaveDetails.some(slave => slave.connected_status === "disconnected")
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -7570,6 +7575,7 @@ exports.particularCategory = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// exports.assignCategorizeIssue = async (request, reply) => {
|
|
|
|
// exports.assignCategorizeIssue = async (request, reply) => {
|
|
|
|
// const { supportId } = request.params;
|
|
|
|
// const { supportId } = request.params;
|
|
|
|
// const { support_teamMemberId, startDate, endDate, category, masterHardwareId } = request.body;
|
|
|
|
// const { support_teamMemberId, startDate, endDate, category, masterHardwareId } = request.body;
|
|
|
|