|
|
@ -4259,3 +4259,31 @@ exports.assignCategorizeIssue = async (request, reply) => {
|
|
|
|
|
|
|
|
|
|
|
|
return reply.send({ message: 'Issue assigned successfully', issue });
|
|
|
|
return reply.send({ message: 'Issue assigned successfully', issue });
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exports.getCategorizedIssue = async (request, reply) => {
|
|
|
|
|
|
|
|
const { support_teamMemberId } = request.params;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const supports = await Support.aggregate([
|
|
|
|
|
|
|
|
{ $unwind: '$categorizedIssues' },
|
|
|
|
|
|
|
|
{ $match: { 'categorizedIssues.assignedTo.support_teamMemberId': support_teamMemberId } },
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$group: {
|
|
|
|
|
|
|
|
_id: '$_id',
|
|
|
|
|
|
|
|
supportId: { $first: '$supportId' },
|
|
|
|
|
|
|
|
categorizedIssues: { $push: '$categorizedIssues' }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (supports.length === 0) {
|
|
|
|
|
|
|
|
return reply.code(404).send({ message: 'No categorized issues assigned to this team member.' });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return reply.send({
|
|
|
|
|
|
|
|
supportId: supports[0].supportId,
|
|
|
|
|
|
|
|
categorizedIssues: supports[0].categorizedIssues
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|