diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-20 09:09:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-20 09:09:13 +0300 |
commit | e49f1ae46a164511ba79a08fea137ced2c357d6b (patch) | |
tree | 56ebd848e8e0278c1dfddd5c9e8f28bb7663a819 /app/services/quick_actions | |
parent | f64bc374ac7d2d597820e6592696b02f1d12fb15 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/quick_actions')
-rw-r--r-- | app/services/quick_actions/target_service.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/app/services/quick_actions/target_service.rb b/app/services/quick_actions/target_service.rb index 6eda3c89e6c..9c228c27523 100644 --- a/app/services/quick_actions/target_service.rb +++ b/app/services/quick_actions/target_service.rb @@ -2,37 +2,37 @@ module QuickActions class TargetService < BaseService - def execute(type, type_id) + def execute(type, type_iid) case type&.downcase when 'issue' - issue(type_id) + issue(type_iid) when 'mergerequest' - merge_request(type_id) + merge_request(type_iid) when 'commit' - commit(type_id) + commit(type_iid) end end private # rubocop: disable CodeReuse/ActiveRecord - def issue(type_id) - return project.issues.build if type_id.nil? + def issue(type_iid) + return project.issues.build if type_iid.nil? - IssuesFinder.new(current_user, project_id: project.id).find_by(iid: type_id) || project.issues.build + IssuesFinder.new(current_user, project_id: project.id).find_by(iid: type_iid) || project.issues.build end # rubocop: enable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord - def merge_request(type_id) - return project.merge_requests.build if type_id.nil? + def merge_request(type_iid) + return project.merge_requests.build if type_iid.nil? - MergeRequestsFinder.new(current_user, project_id: project.id).find_by(iid: type_id) || project.merge_requests.build + MergeRequestsFinder.new(current_user, project_id: project.id).find_by(iid: type_iid) || project.merge_requests.build end # rubocop: enable CodeReuse/ActiveRecord - def commit(type_id) - project.commit(type_id) + def commit(type_iid) + project.commit(type_iid) end end end |