Prevent calling contact point endpoint for other integrations (#4250)
# What this PR does Right now there's an issue where we call the contact point endpoint upon integration creation, even though the integration is not grafana_alerting. The PR addresses this issue
This commit is contained in:
parent
bfeb286637
commit
c8a5f02c3b
1 changed files with 8 additions and 6 deletions
|
|
@ -445,14 +445,16 @@ export const IntegrationForm = observer(
|
|||
return;
|
||||
}
|
||||
|
||||
if (!IntegrationHelper.isSpecificIntegration(selectedIntegration.value, 'grafana_alerting')) {
|
||||
pushHistory(response.id);
|
||||
if (IntegrationHelper.isSpecificIntegration(selectedIntegration.value, 'grafana_alerting')) {
|
||||
await (formData.is_existing
|
||||
? AlertReceiveChannelHelper.connectContactPoint
|
||||
: AlertReceiveChannelHelper.createContactPoint)(
|
||||
response.id,
|
||||
formData.alert_manager,
|
||||
formData.contact_point
|
||||
);
|
||||
}
|
||||
|
||||
await (formData.is_existing
|
||||
? AlertReceiveChannelHelper.connectContactPoint
|
||||
: AlertReceiveChannelHelper.createContactPoint)(response.id, formData.alert_manager, formData.contact_point);
|
||||
|
||||
pushHistory(response.id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue