Skip to content

Commit

Permalink
address the comments by fixing minor issues
Browse files Browse the repository at this point in the history
Signed-off-by: Riya Saxena <[email protected]>
  • Loading branch information
riysaxen-amzn committed May 22, 2024
1 parent 6e74164 commit 77fc3f0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 33 deletions.
17 changes: 6 additions & 11 deletions public/pages/Dashboard/containers/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,12 @@ export default class Dashboard extends Component {
},
},
};
let response;
if (this.dataSourceQuery) {
response = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(params),
query: this.dataSourceQuery?.query,
});
} else {
response = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(params),
});
}

const response = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(params),
query: this.dataSourceQuery?.query,
});

if (response.ok) {
monitors = _.get(response, 'resp.hits.hits', []);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,11 @@ class DestinationsList extends React.Component {
query: isDeleteAllowedQuery(type, id),
index: INDEX.SCHEDULED_JOBS,
};
let resp;
if (this.dataSourceQuery) {
resp = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(requestBody),
query: this.dataSourceQuery.query,
});
} else {
resp = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(requestBody),
});
}
const resp = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(requestBody),
query: this.dataSourceQuery.query,
});

const total = _.get(resp, 'resp.hits.total.value');
return total === 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,12 @@ class MonitorHistory extends PureComponent {
),
index: INDEX.ALL_ALERTS,
};
let resp;
if (this.dataSourceQuery) {
resp = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(requestBody),
query: this.dataSourceQuery?.query,
});
} else {
resp = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(requestBody),
});
}

const resp = await httpClient.post('../api/alerting/monitors/_search', {
body: JSON.stringify(requestBody),
query: this.dataSourceQuery?.query,
});

if (resp.ok) {
const poiData = get(resp, 'resp.aggregations.alerts_over_time.buckets', []).map((item) => ({
x: item.key,
Expand Down

0 comments on commit 77fc3f0

Please sign in to comment.