From 07ecb87f2629afea045f137addd73b8b374f0ade Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Mon, 11 Jul 2022 18:03:25 -0400 Subject: [PATCH] fix(ui): top groups not fetching correct data --- src/client/api/index.js | 2 +- src/controllers/api/v1/tickets.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/client/api/index.js b/src/client/api/index.js index 571088e0a..c18860766 100644 --- a/src/client/api/index.js +++ b/src/client/api/index.js @@ -29,7 +29,7 @@ api.dashboard.getData = payload => { } api.dashboard.getTopGroups = payload => { const timespan = payload.timespan || 30 - return axios.get(`/api/v1/tickets/count/topgroups/${timespan}`).then(res => { + return axios.get(`/api/v1/tickets/count/topgroups/${timespan}/5`).then(res => { return res.data }) } diff --git a/src/controllers/api/v1/tickets.js b/src/controllers/api/v1/tickets.js index 0d57026e2..ae0fa8cf7 100644 --- a/src/controllers/api/v1/tickets.js +++ b/src/controllers/api/v1/tickets.js @@ -1703,17 +1703,17 @@ apiTickets.getTicketStatsForUser = function (req, res) { * */ apiTickets.getTagCount = function (req, res) { - var cache = global.cache - var timespan = req.params.timespan + const cache = global.cache + let timespan = req.params.timespan if (_.isUndefined(timespan) || _.isNaN(timespan)) timespan = 0 if (_.isUndefined(cache)) { return res.status(400).send('Tag stats are still loading...') } - var tags = cache.get('tags:' + timespan + ':usage') + const tags = cache.get('tags:' + timespan + ':usage') - res.json({ success: true, tags: tags }) + res.json({ success: true, tags }) } /**