summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-01 16:27:02 +0000
committerStan Hu <stanhu@gmail.com>2019-08-01 16:27:02 +0000
commitdbc6c2440348578be0e9dfb2197adfe3e9c457dd (patch)
treec3a9a851c4505946c9bd4dbab460e9c6e9835c14 /lib
parent536ebecf7eec95bd2cc1b542f1c35d70f814731e (diff)
parente13b5dc7540b85673e066a7a7c26fc3abbecbfe7 (diff)
downloadgitlab-ce-dbc6c2440348578be0e9dfb2197adfe3e9c457dd.tar.gz
Merge branch '52123-issuable-actions-notesfinder-pderichs' into 'master'
Use NotesFinder to fetch notes on API and Controllers Closes #52123 See merge request gitlab-org/gitlab-ce!31300
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers/notes_helpers.rb2
-rw-r--r--lib/gitlab/project_search_results.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/helpers/notes_helpers.rb b/lib/api/helpers/notes_helpers.rb
index b03ac7deb71..7124ac0c5c3 100644
--- a/lib/api/helpers/notes_helpers.rb
+++ b/lib/api/helpers/notes_helpers.rb
@@ -76,7 +76,7 @@ module API
def find_noteable(parent_type, parent_id, noteable_type, noteable_id)
params = params_by_noteable_type_and_id(noteable_type, noteable_id)
- noteable = NotesFinder.new(user_project, current_user, params).target
+ noteable = NotesFinder.new(current_user, params.merge(project: user_project)).target
noteable = nil unless can?(current_user, noteable_read_ability_name(noteable), noteable)
noteable || not_found!(noteable_type)
end
diff --git a/lib/gitlab/project_search_results.rb b/lib/gitlab/project_search_results.rb
index 0f3b97e2317..827f4f77f36 100644
--- a/lib/gitlab/project_search_results.rb
+++ b/lib/gitlab/project_search_results.rb
@@ -108,7 +108,7 @@ module Gitlab
# rubocop: disable CodeReuse/ActiveRecord
def notes_finder(type)
- NotesFinder.new(project, @current_user, search: query, target_type: type).execute.user.order('updated_at DESC')
+ NotesFinder.new(@current_user, search: query, target_type: type, project: project).execute.user.order('updated_at DESC')
end
# rubocop: enable CodeReuse/ActiveRecord