Skip to content

Commit

Permalink
fix(ui): top groups not fetching correct data
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Jul 11, 2022
1 parent 24993c9 commit 07ecb87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/api/v1/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}

/**
Expand Down

0 comments on commit 07ecb87

Please sign in to comment.