Commit a09fc160d02f232e9819c7459a9ff91a4e990bf3
1 parent
f614fa97
Exists in
master
and in
4 other branches
Add project.all for API if admin
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
10 additions
and
0 deletions
Show diff stats
lib/api/projects.rb
@@ -31,6 +31,16 @@ module API | @@ -31,6 +31,16 @@ module API | ||
31 | present @projects, with: Entities::Project | 31 | present @projects, with: Entities::Project |
32 | end | 32 | end |
33 | 33 | ||
34 | + # Get all projects for admin user | ||
35 | + # | ||
36 | + # Example Request: | ||
37 | + # GET /projects/all | ||
38 | + get '/all' do | ||
39 | + authenticated_as_admin! | ||
40 | + @projects = paginate Project | ||
41 | + present @projects, with: Entities::Project | ||
42 | + end | ||
43 | + | ||
34 | # Get a single project | 44 | # Get a single project |
35 | # | 45 | # |
36 | # Parameters: | 46 | # Parameters: |