mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-18 00:56:41 +10:00
Add group filtering by name for API
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
+8
-5
@@ -25,11 +25,14 @@ module API
|
||||
# Example Request:
|
||||
# GET /groups
|
||||
get do
|
||||
if current_user.admin
|
||||
@groups = paginate Group
|
||||
else
|
||||
@groups = paginate current_user.groups
|
||||
end
|
||||
@groups = if current_user.admin
|
||||
Group.all
|
||||
else
|
||||
current_user.groups
|
||||
end
|
||||
|
||||
@groups = @groups.search(params[:search]) if params[:search].present?
|
||||
@groups = paginate @groups
|
||||
present @groups, with: Entities::Group
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user