Include nested groups items into search results
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
15ad1d8815
commit
d6febcaf3e
1 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,11 @@ module Search
|
|||
def execute
|
||||
group = Group.find_by(id: params[:group_id]) if params[:group_id].present?
|
||||
projects = ProjectsFinder.new.execute(current_user)
|
||||
projects = projects.in_namespace(group.id) if group
|
||||
|
||||
if group
|
||||
ids = group.descendants.push(group.id)
|
||||
projects = projects.in_namespace(ids)
|
||||
end
|
||||
|
||||
Gitlab::SearchResults.new(current_user, projects, params[:search])
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue