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:
Rares Mardare 2024-04-18 17:23:06 +03:00 committed by GitHub
parent bfeb286637
commit c8a5f02c3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}