summaryrefslogtreecommitdiff
path: root/app/models/project_services/alerts_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project_services/alerts_service.rb')
-rw-r--r--app/models/project_services/alerts_service.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/project_services/alerts_service.rb b/app/models/project_services/alerts_service.rb
index 28902114f3c..5b7d149ace1 100644
--- a/app/models/project_services/alerts_service.rb
+++ b/app/models/project_services/alerts_service.rb
@@ -14,6 +14,8 @@ class AlertsService < Service
before_validation :prevent_token_assignment
before_validation :ensure_token, if: :activated?
+ after_save :update_http_integration
+
def url
return if instance? || template?
@@ -77,6 +79,14 @@ class AlertsService < Service
def url_helpers
Gitlab::Routing.url_helpers
end
+
+ def update_http_integration
+ return unless project_id && type == 'AlertsService'
+
+ AlertManagement::SyncAlertServiceDataService # rubocop: disable CodeReuse/ServiceClass
+ .new(self)
+ .execute
+ end
end
AlertsService.prepend_if_ee('EE::AlertsService')