diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2016-11-10 12:26:41 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2016-11-10 12:26:41 +0300 |
commit | a29544f5fee8ba65fcfea0689b0c60b77d8784ab (patch) | |
tree | 4b670fbc30b67525311d2ab81b1f063e9102f98e /lib/api | |
parent | 0c99e5d0b6b457ef7db2c36f1394fad5c63d1142 (diff) | |
parent | 4f2c4411615a7c870fd1fa54525079f7ea97d6e5 (diff) |
Merge branch 'feature/api_owned_resource' into 'master'
Add api endpoint `/groups/owned`
See merge request !7103
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/groups.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb index a13e353b7f5..40644fc2adf 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -26,6 +26,16 @@ module API present @groups, with: Entities::Group end + # Get list of owned groups for authenticated user + # + # Example Request: + # GET /groups/owned + get '/owned' do + @groups = current_user.owned_groups + @groups = paginate @groups + present @groups, with: Entities::Group, user: current_user + end + # Create group. Available only for users who can create groups. # # Parameters: |