diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2015-01-12 11:08:53 +0100 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2015-01-12 11:08:53 +0100 |
commit | 8689ce1efef8438debeec2a3a6d669f4d5a435c4 (patch) | |
tree | ec6757d8ae062bbd8ceb38ebb7d136932302d5a3 /lib/api/projects.rb | |
parent | 31bcd04711d448c016506897b8431273e3454faa (diff) | |
download | gitlab-ce-8689ce1efef8438debeec2a3a6d669f4d5a435c4.tar.gz |
Add search filter option on project api for authorized projects.
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index e1cc2348865..b9c95c785f2 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -15,9 +15,6 @@ module API # Get a projects list for authenticated user # - # Parameters: - # archived (optional) - if passed, limit by archived status - # # Example Request: # GET /projects get do @@ -37,6 +34,10 @@ module API @projects = @projects.where(archived: parse_boolean(params[:archived])) end + if params[:search].present? + @projects = @projects.search(params[:search]) + end + @projects = paginate @projects present @projects, with: Entities::Project end |