Skip to content

Commit

Permalink
fix: fix open tickets count
Browse files Browse the repository at this point in the history
Signed-off-by: Vin <[email protected]>
  • Loading branch information
VinDotRun committed Nov 15, 2023
1 parent 539ed75 commit b17236c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/listeners/client/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ module.exports = class extends Listener {
firstResponseAt: true,
},
});
const closedTickets = tickets.filter(t => t.firstResponseAt && t.closedAt);
const closedTicketsWithResponse = tickets.filter(t => t.firstResponseAt && t.closedAt);
const closedTickets = tickets.filter(t => t.closedAt);
cached = {
avgResolutionTime: ms(getAvgResolutionTime(closedTickets)),
avgResponseTime: ms(getAvgResponseTime(closedTickets)),
avgResolutionTime: ms(getAvgResolutionTime(closedTicketsWithResponse)),
avgResponseTime: ms(getAvgResponseTime(closedTicketsWithResponse)),
openTickets: tickets.length - closedTickets.length,
totalTickets: tickets.length,
};
Expand Down

0 comments on commit b17236c

Please sign in to comment.