Skip to content

Commit

Permalink
Ensure we add the alert to the list so we can render the right state …
Browse files Browse the repository at this point in the history
…after creating alerts
  • Loading branch information
chrisronline committed Oct 16, 2019
1 parent 0a9048e commit faf4ad2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ export function MigrationStatus({ clusterUuid }) {
async function createKibanaAlerts() {
setIsCreating(true);

await kfetch({
const { alerts } = await kfetch({
method: 'POST',
pathname: `/api/monitoring/v1/clusters/${clusterUuid}/alerts`,
body: JSON.stringify({ selectedEmailActionId })
});

setIsCreating(false);
setShowCreate(false);
setKibanaAlerts([
...kibanaAlerts,
...alerts,
]);
}

// async function deleteKibanaAlerts() {
Expand Down

0 comments on commit faf4ad2

Please sign in to comment.