diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 09:08:42 +0000 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /lib/api/groups.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) | |
download | gitlab-ce-b76ae638462ab0f673e5915986070518dd3f9ad3.tar.gz |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'lib/api/groups.rb')
-rw-r--r-- | lib/api/groups.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 9b6b28733ff..0896357cc73 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -35,7 +35,8 @@ module API :all_available, :custom_attributes, :owned, :min_access_level, - :include_parent_descendants + :include_parent_descendants, + :search ) find_params[:parent] = if params[:top_level_only] @@ -48,7 +49,6 @@ module API find_params.fetch(:all_available, current_user&.can_read_all_resources?) groups = GroupsFinder.new(current_user, find_params).execute - groups = groups.search(params[:search], include_parents: true) if params[:search].present? groups = groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present? order_groups(groups) @@ -128,10 +128,6 @@ module API groups.reorder(group_without_similarity_options) # rubocop: disable CodeReuse/ActiveRecord end - def order_by_similarity? - params[:order_by] == 'similarity' && params[:search].present? - end - def group_without_similarity_options order_options = { params[:order_by] => params[:sort] } order_options['name'] = order_options.delete('similarity') if order_options.has_key?('similarity') @@ -141,7 +137,7 @@ module API # rubocop: disable CodeReuse/ActiveRecord def handle_similarity_order(group, projects) - if params[:search].present? && Feature.enabled?(:similarity_search, group, default_enabled: true) + if params[:search].present? projects.sorted_by_similarity_desc(params[:search]) else order_options = { name: :asc } |