summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-12-24 13:38:17 +0200
committerValery Sizov <vsv2711@gmail.com>2015-12-24 13:38:17 +0200
commit999a374f778909b3681190dcf0936ba9bb989413 (patch)
tree03a14e9bc34eb856a66c3a641ac1383d21a6f396 /lib/api/projects.rb
parentd794ae8e1f6351282707d45df97ac0ec2a41eeb6 (diff)
parente557c8d0a2c1b05148a9d73a8a658962a3ef6147 (diff)
downloadgitlab-ce-999a374f778909b3681190dcf0936ba9bb989413.tar.gz
Merge branch 'emoji-picker-search'into emoji_picker_frequently_usedemoji_picker_frequently_used
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index bdf4b77596e..a9e0960872a 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -25,7 +25,7 @@ module API
@projects = current_user.authorized_projects
@projects = filter_projects(@projects)
@projects = paginate @projects
- present @projects, with: Entities::Project
+ present @projects, with: Entities::ProjectWithAccess, user: current_user
end
# Get an owned projects list for authenticated user
@@ -36,6 +36,17 @@ module API
@projects = current_user.owned_projects
@projects = filter_projects(@projects)
@projects = paginate @projects
+ present @projects, with: Entities::ProjectWithAccess, user: current_user
+ end
+
+ # Gets starred project for the authenticated user
+ #
+ # Example Request:
+ # GET /projects/starred
+ get '/starred' do
+ @projects = current_user.starred_projects
+ @projects = filter_projects(@projects)
+ @projects = paginate @projects
present @projects, with: Entities::Project
end
@@ -48,7 +59,7 @@ module API
@projects = Project.all
@projects = filter_projects(@projects)
@projects = paginate @projects
- present @projects, with: Entities::Project
+ present @projects, with: Entities::ProjectWithAccess, user: current_user
end
# Get a single project