From e8d2c2579383897a1dd7f9debd359abe8ae8373d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 20 Jul 2021 09:55:51 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-1-stable-ee --- .../jira_connect_installations/destroy_service.rb | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/services/jira_connect_installations/destroy_service.rb (limited to 'app/services/jira_connect_installations') diff --git a/app/services/jira_connect_installations/destroy_service.rb b/app/services/jira_connect_installations/destroy_service.rb new file mode 100644 index 00000000000..cfe58575dcf --- /dev/null +++ b/app/services/jira_connect_installations/destroy_service.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module JiraConnectInstallations + class DestroyService + def self.execute(installation, jira_connect_base_path, jira_connect_uninstalled_event_path) + new(installation, jira_connect_base_path, jira_connect_uninstalled_event_path).execute + end + + def initialize(installation, jira_connect_base_path, jira_connect_uninstalled_event_path) + @installation = installation + @jira_connect_base_path = jira_connect_base_path + @jira_connect_uninstalled_event_path = jira_connect_uninstalled_event_path + end + + def execute + if @installation.instance_url.present? + JiraConnect::ForwardEventWorker.perform_async(@installation.id, @jira_connect_base_path, @jira_connect_uninstalled_event_path) + return true + end + + @installation.destroy + end + end +end -- cgit v1.2.3