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
Léo-Paul Géneau
gitlab-ce
Commits
fcf90d05
Commit
fcf90d05
authored
Feb 06, 2019
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
un-dry the search api scope
due to the usage in EE this attempt to more DRYness is not worth it.
parent
b0981097
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
lib/api/search.rb
lib/api/search.rb
+12
-12
No files found.
lib/api/search.rb
View file @
fcf90d05
...
...
@@ -58,15 +58,6 @@ module API
render_api_error!
({
error:
_
(
"Scope not supported with disabled 'users_search' feature!"
)
},
400
)
end
end
params
:scope
do
|
options
|
values
=
SCOPE_ENTITY
.
stringify_keys
.
slice
(
*
options
[
:values
]).
keys
requires
:scope
,
type:
String
,
desc:
'The scope of the search'
,
values:
values
end
end
resource
:search
do
...
...
@@ -75,7 +66,10 @@ module API
end
params
do
requires
:search
,
type:
String
,
desc:
'The expression it should be searched for'
use
:scope
,
values:
Helpers
::
SearchHelpers
.
global_search_scopes
requires
:scope
,
type:
String
,
desc:
'The scope of the search'
,
values:
Helpers
::
SearchHelpers
.
global_search_scopes
use
:pagination
end
get
do
...
...
@@ -93,7 +87,10 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:search
,
type:
String
,
desc:
'The expression it should be searched for'
use
:scope
,
values:
Helpers
::
SearchHelpers
.
group_search_scopes
requires
:scope
,
type:
String
,
desc:
'The scope of the search'
,
values:
Helpers
::
SearchHelpers
.
group_search_scopes
use
:pagination
end
get
':id/(-/)search'
do
...
...
@@ -111,7 +108,10 @@ module API
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:search
,
type:
String
,
desc:
'The expression it should be searched for'
use
:scope
,
Helpers
::
SearchHelpers
.
project_search_scopes
requires
:scope
,
type:
String
,
desc:
'The scope of the search'
,
values:
Helpers
::
SearchHelpers
.
project_search_scopes
use
:pagination
end
get
':id/(-/)search'
do
...
...
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