diff options
author | Toon Claes <toon@gitlab.com> | 2017-05-26 17:31:37 +0300 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-05-30 23:45:59 +0300 |
commit | db679788e46d55984a4af71034c6db11aed919e4 (patch) | |
tree | d6fdb9d57f5156e9be56b0f583ff1a4d7c76fa57 /lib/api/helpers.rb | |
parent | 5654ac877df5b6007606e0e1827d965bdf8e552b (diff) |
Add :owned param to ProjectFinder
And use it in the API.
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 17f57cfb8d7..d61450f8258 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -256,16 +256,13 @@ module API # project helpers - def filter_projects(projects) - if params[:owned] - projects = projects.merge(current_user.owned_projects) - end - + def reorder_projects(projects) projects.reorder(params[:order_by] => params[:sort]) end def project_finder_params finder_params = {} + finder_params[:owned] = true if params[:owned].present? finder_params[:non_public] = true if params[:membership].present? finder_params[:starred] = true if params[:starred].present? finder_params[:visibility_level] = Gitlab::VisibilityLevel.level_value(params[:visibility]) if params[:visibility] |