summaryrefslogtreecommitdiff
path: root/lib/api/project_snippets.rb
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-03-01 21:23:00 +0100
committerToon Claes <toon@gitlab.com>2017-03-02 12:15:25 +0100
commita3fdd6acd27f5aa98f13e7a0083d0c3208003ccb (patch)
treee174834a5aaf50b0444f829e8a2cfd678e833455 /lib/api/project_snippets.rb
parentbc20fa9b02d5fea8f5781b6397af10f006983111 (diff)
downloadgitlab-ce-a3fdd6acd27f5aa98f13e7a0083d0c3208003ccb.tar.gz
Use string based `visibility` getter & setter
Add `visibility` & `visibility=` methods to the `Gitlab::VisibilityLevel` module so the `visibility_level` can be get/set with a string value.
Diffstat (limited to 'lib/api/project_snippets.rb')
-rw-r--r--lib/api/project_snippets.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/project_snippets.rb b/lib/api/project_snippets.rb
index 31919a6270d..f57e7ea4032 100644
--- a/lib/api/project_snippets.rb
+++ b/lib/api/project_snippets.rb
@@ -56,7 +56,7 @@ module API
end
post ":id/snippets" do
authorize! :create_project_snippet, user_project
- snippet_params = map_visibility_level(declared_params).merge(request: request, api: true)
+ snippet_params = declared_params.merge(request: request, api: true)
snippet_params[:content] = snippet_params.delete(:code)
snippet = CreateSnippetService.new(user_project, current_user, snippet_params).execute
@@ -89,7 +89,7 @@ module API
authorize! :update_project_snippet, snippet
- snippet_params = map_visibility_level(declared_params(include_missing: false))
+ snippet_params = declared_params(include_missing: false)
.merge(request: request, api: true)
snippet_params[:content] = snippet_params.delete(:code) if snippet_params[:code].present?