Skip to content

Commit

Permalink
fix: open tickets count (#500)
Browse files Browse the repository at this point in the history
Signed-off-by: Vin <28811713+VinDotRun@users.noreply.github.com>
  • Loading branch information
VinDotRun committed Nov 16, 2023
1 parent 539ed75 commit b329d5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/listeners/client/ready.js
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 b329d5a

Please sign in to comment.