mirror of
https://gitlab.com/gitlab-org/gitlab-foss.git
synced 2025-08-20 14:11:11 +00:00
Use ProjectFinder to filter the projects
Instead of trying to do the heavy lifting in the API itself, use the existing features of the ProjectFinder.
This commit is contained in:
@ -70,6 +70,10 @@ module API
|
||||
def present_projects(options = {})
|
||||
finder_params = {}
|
||||
finder_params[:non_public] = true if params[:membership].present?
|
||||
finder_params[:starred] = true if params[:starred].present?
|
||||
finder_params[:visibility_level] = Gitlab::VisibilityLevel.level_value(params[:visibility]) if params[:visibility]
|
||||
finder_params[:archived] = params[:archived]
|
||||
finder_params[:search] = params[:search] if params[:search]
|
||||
|
||||
projects = ProjectsFinder.new(current_user: current_user, params: finder_params).execute
|
||||
projects = filter_projects(projects)
|
||||
|
Reference in New Issue
Block a user