diff options
author | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-07-08 11:47:09 +0300 |
---|---|---|
committer | tiagonbotelho <tiagonbotelho@hotmail.com> | 2016-07-12 18:36:42 +0300 |
commit | f5d92d120edbd6bc730f10293a5847dd9b0e22fc (patch) | |
tree | 8989207a7c631738110701b255ba4720e46164ce /lib/api/projects.rb | |
parent | 6715ea7dc8b92e54e728f155cc4edeb917585168 (diff) |
changes the usage of simpleprojectdetails to already implemented basicprojectsdetails and changes the url to a more reader friendly format
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index c1e66b239aa..c46764c4897 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -25,18 +25,11 @@ module API @projects = current_user.authorized_projects @projects = filter_projects(@projects) @projects = paginate @projects - present @projects, with: Entities::ProjectWithAccess, user: current_user - end - - # Get a simplified project list for authenticated user - # - # Example Request: - # GET /projects/simple - get '/simple' do - @projects = current_user.authorized_projects - @projects = filter_projects(@projects) - @projects = paginate @projects - present @projects, with: Entities::SimpleProjectWithAccess, user: current_user + if params["format"] + present @projects, with: Entities::BasicProjectWithAccess, user: current_user + else + present @projects, with: Entities::ProjectWithAccess, user: current_user + end end # Get an owned projects list for authenticated user |