Skip to content

Commit

Permalink
fix(dashboard): fails to load if show overdue tickets is disabled #552
Browse files Browse the repository at this point in the history
  • Loading branch information
polonel committed Aug 20, 2022
1 parent 8083684 commit afd9caf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/client/reducers/dashboardReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ const reducer = handleActions(
},

[FETCH_DASHBOARD_OVERDUE_TICKETS.SUCCESS]: (state, action) => {
if (action.response.success && action.response.error) {
return { ...state, loadingOverdueTickets: false, overdueTickets: initialState.overdueTickets }
}

return {
...state,
loadingOverdueTickets: false,
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/api/v1/tickets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,7 @@ apiTickets.getOverdue = function (req, res) {
],
function (err, overdueTickets) {
if (err) return res.status(400).json({ success: false, error: err.message })

if (!overdueTickets) overdueTickets = []
return res.json({ success: true, tickets: overdueTickets })
}
)
Expand Down

0 comments on commit afd9caf

Please sign in to comment.