From 4f2c4411615a7c870fd1fa54525079f7ea97d6e5 Mon Sep 17 00:00:00 2001 From: Borja Aparicio Date: Tue, 25 Oct 2016 15:22:12 +0200 Subject: Added API endpoint groups/owned --- lib/api/groups.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/api') 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: -- cgit v1.2.3