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 ...@@ -15,7 +15,7 @@ module AlertManagement
return error_no_permissions unless allowed? return error_no_permissions unless allowed?
return error_issue_already_exists if alert.issue return error_issue_already_exists if alert.issue
result = create_issue result = create_incident
return result unless result.success? return result unless result.success?
issue = result.payload[:issue] issue = result.payload[:issue]
...@@ -36,7 +36,7 @@ module AlertManagement ...@@ -36,7 +36,7 @@ module AlertManagement
user.can?(:create_issue, project) user.can?(:create_issue, project)
end end
def create_issue def create_incident
::IncidentManagement::Incidents::CreateService.new( ::IncidentManagement::Incidents::CreateService.new(
project, project,
user, user,
......
...@@ -13,7 +13,7 @@ module IncidentManagement ...@@ -13,7 +13,7 @@ module IncidentManagement
return error_with('setting disabled') unless incident_management_setting.create_issue? return error_with('setting disabled') unless incident_management_setting.create_issue?
return error_with('invalid alert') unless alert.valid? 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? return error_with(result.message, result.payload[:issue]) unless result.success?
result result
...@@ -21,7 +21,7 @@ module IncidentManagement ...@@ -21,7 +21,7 @@ module IncidentManagement
private private
def create_issue def create_incident
::IncidentManagement::Incidents::CreateService.new( ::IncidentManagement::Incidents::CreateService.new(
project, project,
current_user, current_user,
......
...@@ -12,14 +12,14 @@ module IncidentManagement ...@@ -12,14 +12,14 @@ module IncidentManagement
def execute def execute
return forbidden unless webhook_available? return forbidden unless webhook_available?
create_issue create_incident
end end
private private
alias_method :incident_payload, :params alias_method :incident_payload, :params
def create_issue def create_incident
::IncidentManagement::Incidents::CreateService.new( ::IncidentManagement::Incidents::CreateService.new(
project, project,
current_user, 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