Skip to content

Commit

Permalink
Fix the then for checking observability dashboards
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Jul 24, 2024
1 parent 85400e7 commit 9be95bb
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ export const ManageDirectQueryDataConnectionsTable: React.FC<ManageDirectQueryDa
mode: 'cors',
credentials: 'include',
})
.then(function (response) {
return response.json();
})
.then((data) => {
for (let i = 0; i < data.status.statuses.length; ++i) {
if (data.status.statuses[i].id.includes('plugin:observabilityDashboards')) {
.then((response) =>
response.json().then((data) => {
const pluginExists = data.status.statuses.some((status: { id: string | string[] }) =>
status.id.includes('plugin:observabilityDashboards')
);
if (pluginExists) {
setObservabilityDashboardsExists(true);
}
}
})
})
)
.catch((error) => {
notifications.toasts.addDanger(
'Error checking Dashboards Observability Plugin Installation status.'
Expand Down

0 comments on commit 9be95bb

Please sign in to comment.