Skip to content

Commit

Permalink
Fix [Alerts] Pagination Error Due to Failed API Response (#3010)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinis-gini-apps authored Jan 13, 2025
1 parent b24d472 commit 5b6330d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/hooks/useAlertsPageData.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@ export const useAlertsPageData = (filters, isAlertsPage) => {
)
.unwrap()
.then(response => {
if (response?.activations?.length > 0) {
setAlerts(response.activations)
} else {
setAlerts([])
if (response?.activations) {
setAlerts(response.activations.length > 0 ? response.activations : [])
paginationConfigAlertsRef.current.paginationResponse = response.pagination
}
paginationConfigAlertsRef.current.paginationResponse = response.pagination
})
},
[dispatch, isAlertsPage, params.id, params.projectName]
Expand Down

0 comments on commit 5b6330d

Please sign in to comment.