master^2
Bhaskar 4 months ago
parent 93599bfcf5
commit 2b7234ad1e

@ -5345,6 +5345,7 @@ exports.particularCategory = async (req, reply) => {
};
exports.assignCategorizeIssue = async (request, reply) => {
const { supportId } = request.params;
const { support_teamMemberId, startDate, endDate, category, masterHardwareId } = request.body;
@ -5371,10 +5372,13 @@ exports.assignCategorizeIssue = async (request, reply) => {
return reply.code(400).send({ error: 'Invalid startDate or endDate' });
}
// ✅ Format to "DD-MM-YYYY HH:mm:ss"
const formattedStart = moment(start).format("DD-MM-YYYY HH:mm:ss");
const formattedEnd = moment(end).format("DD-MM-YYYY HH:mm:ss");
let assignedCount = 0;
support.categorizedIssues.forEach(issue => {
const issueDate = new Date(issue.movedAt);
if (
issue.masterHardwareId === masterHardwareId &&
issue.category === category
@ -5384,8 +5388,8 @@ exports.assignCategorizeIssue = async (request, reply) => {
support_teamMemberId: teamMember.support_teamMemberId,
phone: teamMember.phone,
email: teamMember.email,
startDate: startDate, // Add startDate
endDate: endDate // Add endDate
startDate: formattedStart, // 👈 use formatted date
endDate: formattedEnd // 👈 use formatted date
};
assignedCount++;
}

Loading…
Cancel
Save