Commit 8e7b75b1 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Rename create_issue to create_incident

Rename methods in create incident service classes
parent 20dd843d
......@@ -15,7 +15,7 @@ module AlertManagement
return error_no_permissions unless allowed?
return error_issue_already_exists if alert.issue
result = create_issue
result = create_incident
return result unless result.success?
issue = result.payload[:issue]
......@@ -36,7 +36,7 @@ module AlertManagement
user.can?(:create_issue, project)
end
def create_issue
def create_incident
::IncidentManagement::Incidents::CreateService.new(
project,
user,
......
......@@ -13,7 +13,7 @@ module IncidentManagement
return error_with('setting disabled') unless incident_management_setting.create_issue?
return error_with('invalid alert') unless alert.valid?
result = create_issue
result = create_incident
return error_with(result.message, result.payload[:issue]) unless result.success?
result
......@@ -21,7 +21,7 @@ module IncidentManagement
private
def create_issue
def create_incident
::IncidentManagement::Incidents::CreateService.new(
project,
current_user,
......
......@@ -12,14 +12,14 @@ module IncidentManagement
def execute
return forbidden unless webhook_available?
create_issue
create_incident
end
private
alias_method :incident_payload, :params
def create_issue
def create_incident
::IncidentManagement::Incidents::CreateService.new(
project,
current_user,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment