From b329d5ae2e0e64b0752d0f452170f4d58accc735 Mon Sep 17 00:00:00 2001 From: Vin <28811713+VinDotRun@users.noreply.github.com> Date: Wed, 15 Nov 2023 21:35:32 -0300 Subject: [PATCH] fix: open tickets count (#500) Signed-off-by: Vin <28811713+VinDotRun@users.noreply.github.com> --- src/listeners/client/ready.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/listeners/client/ready.js b/src/listeners/client/ready.js index a1edaaf..0f273e7 100644 --- a/src/listeners/client/ready.js +++ b/src/listeners/client/ready.js @@ -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, };