Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Fix ack alert API
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianli Feng committed Nov 16, 2020
1 parent 71db812 commit 32e202f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion public/pages/Dashboard/containers/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ export default class Dashboard extends Component {

const promises = Object.entries(monitorAlerts).map(([monitorId, alerts]) =>
httpClient
.post(`../api/alerting/monitors/${monitorId}/_acknowledge/alerts`, { alerts })
.post(`../api/alerting/monitors/${monitorId}/_acknowledge/alerts`, {
body: JSON.stringify({ alerts }),
})
.catch((error) => error)
);

Expand Down
6 changes: 2 additions & 4 deletions public/pages/Monitors/containers/Monitors/Monitors.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export default class Monitors extends Component {
const promises = Object.entries(monitorAlerts).map(([monitorId, alerts]) =>
httpClient
.post(`../api/alerting/monitors/${monitorId}/_acknowledge/alerts`, {
body: JSON.stringify(alerts),
body: JSON.stringify({ alerts }),
})
.catch((error) => error)
);
Expand Down Expand Up @@ -305,9 +305,7 @@ export default class Monitors extends Component {
const response = await httpClient.get('../api/alerting/alerts', { query: params });

if (response.ok) {
const {
data: { alerts, totalAlerts },
} = response;
const { alerts, totalAlerts } = response;
this.setState({
alerts,
totalAlerts,
Expand Down
1 change: 1 addition & 0 deletions server/routes/monitors.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export default function (services, router) {
params: schema.object({
id: schema.string(),
}),
body: schema.any(),
},
},
monitorService.acknowledgeAlerts
Expand Down

0 comments on commit 32e202f

Please sign in to comment.