Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-10-05 22:58:33 +0300
committerFatih Acet <acetfatih@gmail.com>2016-10-05 22:58:33 +0300
commitf5e30567c8fb5d441a2a53c39a5fc24fc897a625 (patch)
tree44a485fcc3ab61ce35a3b385ec6df68ff5da2182 /lib
parent966bbb9f3110e1bb390334653caedec55cc8c6a3 (diff)
parent35ced4dae480d61ddc4d73eb4695626ecc419e9c (diff)
Merge branch 'fix_group_links_404' into 'master'
fix group links 404 ### What does this MR do? This MR should fix the 404 page, when creating a new group links without selecting any group from the group dropdown list. ### What are the relevant issue numbers? Closes #20766 See merge request !6155
Diffstat (limited to 'lib')
-rw-r--r--lib/api/groups.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/groups.rb b/lib/api/groups.rb
index 953fa474e88..bfb89475025 100644
--- a/lib/api/groups.rb
+++ b/lib/api/groups.rb
@@ -6,6 +6,8 @@ module API
resource :groups do
# Get a groups list
#
+ # Parameters:
+ # skip_groups (optional) - Array of group ids to exclude from list
# Example Request:
# GET /groups
get do
@@ -16,6 +18,7 @@ module API
end
@groups = @groups.search(params[:search]) if params[:search].present?
+ @groups = @groups.where.not(id: params[:skip_groups]) if params[:skip_groups].present?
@groups = paginate @groups
present @groups, with: Entities::Group
end