Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
2660e83c
Commit
2660e83c
authored
Dec 30, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add group filtering by name for API
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
da9d8279
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
doc/api/groups.md
doc/api/groups.md
+2
-0
lib/api/groups.rb
lib/api/groups.rb
+8
-5
No files found.
doc/api/groups.md
View file @
2660e83c
...
@@ -19,6 +19,8 @@ GET /groups
...
@@ -19,6 +19,8 @@ GET /groups
]
]
```
```
You can search for groups by name or path with:
`/groups?search=Rails`
## Details of a group
## Details of a group
Get all details of a group.
Get all details of a group.
...
...
lib/api/groups.rb
View file @
2660e83c
...
@@ -25,11 +25,14 @@ module API
...
@@ -25,11 +25,14 @@ module API
# Example Request:
# Example Request:
# GET /groups
# GET /groups
get
do
get
do
if
current_user
.
admin
@groups
=
if
current_user
.
admin
@groups
=
paginate
Group
Group
.
all
else
else
@groups
=
paginate
current_user
.
groups
current_user
.
groups
end
end
@groups
=
@groups
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@groups
=
paginate
@groups
present
@groups
,
with:
Entities
::
Group
present
@groups
,
with:
Entities
::
Group
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment