diff options
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 5e9e14ad00a..13f81e9506f 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -22,10 +22,10 @@ module API # Example Request: # GET /projects get do - @projects = current_user.authorized_projects - @projects = filter_projects(@projects) - @projects = paginate @projects - present @projects, with: Entities::ProjectWithAccess, user: current_user + projects = ProjectsFinder.execute(current_user, scope: :authorized) + projects = filter_projects(projects) + projects = paginate(projects) + present projects, with: Entities::ProjectWithAccess, user: current_user end # Get an owned projects list for authenticated user @@ -43,6 +43,7 @@ module API # # Example Request: # GET /projects/starred + # TODO ZJ -- Use the ProjectsFinder here get '/starred' do @projects = current_user.viewable_starred_projects @projects = filter_projects(@projects) @@ -56,7 +57,7 @@ module API # GET /projects/all get '/all' do authenticated_as_admin! - @projects = Project.without_pending_delete + @projects = ProjectsFinder.execute(current_user, scope: :all) @projects = filter_projects(@projects) @projects = paginate @projects present @projects, with: Entities::ProjectWithAccess, user: current_user |