summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorSimon Knox <psimyn@gmail.com>2017-02-16 13:10:32 +1100
committerSimon Knox <psimyn@gmail.com>2017-02-16 13:10:32 +1100
commit8a928af0fc54a84c5b858955e7459512155d4af0 (patch)
tree4c55ff6c1cd20405e9adf5973e2ce1c229fcebde /lib/api/helpers.rb
parent3f713db0da2602152aa482b57f84b7418fd20a93 (diff)
parentb05e75b8faccc50749adc63419074c91802a8f50 (diff)
downloadgitlab-ce-task_list_refactor.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into task_list_refactortask_list_refactor
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index dfab60f7fa5..13896dd91b9 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -256,6 +256,14 @@ module API
# project helpers
def filter_projects(projects)
+ if params[:owned]
+ projects = projects.merge(current_user.owned_projects)
+ end
+
+ if params[:starred]
+ projects = projects.merge(current_user.starred_projects)
+ end
+
if params[:search].present?
projects = projects.search(params[:search])
end