|
|
|
@ -6954,14 +6954,22 @@ exports.moveIssueToCategory = async (req, reply) => {
|
|
|
|
|
|
|
|
|
|
const issue = support.issues[index];
|
|
|
|
|
|
|
|
|
|
// Normalize type if it's invalid
|
|
|
|
|
const normalizedType =
|
|
|
|
|
issue.type === "GSM or LoRa Disconnected" ? "GSM Disconnected" : issue.type;
|
|
|
|
|
|
|
|
|
|
if (issue.hardwareId === hardwareId) {
|
|
|
|
|
issue.movedToCategory = true; // ✅ Mark moved
|
|
|
|
|
issue.movedToCategory = true;
|
|
|
|
|
|
|
|
|
|
support.categorizedIssues.push({
|
|
|
|
|
...issue,
|
|
|
|
|
type: normalizedType,
|
|
|
|
|
hardwareId: issue.hardwareId,
|
|
|
|
|
masterHardwareId: issue.masterHardwareId || issue.hardwareId,
|
|
|
|
|
category,
|
|
|
|
|
movedAt: nowTime,
|
|
|
|
|
movedToCategory: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
support.issues.splice(index, 1);
|
|
|
|
|
issueMoved = true;
|
|
|
|
|
} else {
|
|
|
|
@ -6970,13 +6978,13 @@ exports.moveIssueToCategory = async (req, reply) => {
|
|
|
|
|
const slaveName = issue.slaveNames?.[slaveIndex] || "Unknown";
|
|
|
|
|
|
|
|
|
|
support.categorizedIssues.push({
|
|
|
|
|
type: issue.type,
|
|
|
|
|
type: normalizedType,
|
|
|
|
|
hardwareId,
|
|
|
|
|
masterHardwareId: issue.masterHardwareId || issue.hardwareId,
|
|
|
|
|
slaveName,
|
|
|
|
|
category,
|
|
|
|
|
movedAt: nowTime,
|
|
|
|
|
movedToCategory: true, // ✅ Track it here too
|
|
|
|
|
movedToCategory: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
issue.hardwareIds.splice(slaveIndex, 1);
|
|
|
|
@ -7002,6 +7010,7 @@ exports.moveIssueToCategory = async (req, reply) => {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.particularCategory = async (req, reply) => {
|
|
|
|
|
try {
|
|
|
|
|
const { supportId, category } = req.params;
|
|
|
|
|