Move filtering from API::Groups#find_groups into GroupsFinder
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Move filtering and ordering done on https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/groups.rb#L30 into GroupProjectsFinder.
The following statements should me moved into GroupFinder
groups = groups.search(params[:search]) if params[:search].present?
groups = groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present?
order_options = { params[:order_by] => params[:sort] }
order_options["id"] ||= "asc"
groups = groups.reorder(order_options)
Edited by 🤖 GitLab Bot 🤖