Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-07-16 21:29:14 +0300
committerRémy Coutable <remy@rymai.me>2018-07-16 21:29:14 +0300
commit7f0431dd8550ac9d229d1383c03386c1634d015f (patch)
treeed4e1e1ed3964d180d51460f14aa35a53834c8c8 /lib
parentc82adcce6b21272d3d9c8cee541ed03e60e65439 (diff)
parent209fd86442930ffd398849e386d9d13e699799c7 (diff)
Merge branch 'fix-project-api-archived' into 'master'
Fix archived parameter for projects API Closes #32301 See merge request gitlab-org/gitlab-ce!20566
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers.rb8
-rw-r--r--lib/api/projects.rb2
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 9c53b7c3fe7..f7737468148 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -385,7 +385,7 @@ module API
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]
- finder_params[:archived] = params[:archived]
+ finder_params[:archived] = archived_param unless params[:archived].nil?
finder_params[:search] = params[:search] if params[:search]
finder_params[:user] = params.delete(:user) if params[:user]
finder_params[:custom_attributes] = params[:custom_attributes] if params[:custom_attributes]
@@ -496,5 +496,11 @@ module API
exception.status == 500
end
+
+ def archived_param
+ return 'only' if params[:archived]
+
+ params[:archived]
+ end
end
end
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 8273abe48c9..0888e3befac 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -30,7 +30,7 @@ module API
end
params :filter_params do
- optional :archived, type: Boolean, default: false, desc: 'Limit by archived status'
+ optional :archived, type: Boolean, desc: 'Limit by archived status'
optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values,
desc: 'Limit by visibility'
optional :search, type: String, desc: 'Return list of projects matching the search criteria'