diff options
author | Toon Claes <toon@gitlab.com> | 2017-03-01 21:23:00 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-03-02 12:15:25 +0100 |
commit | a3fdd6acd27f5aa98f13e7a0083d0c3208003ccb (patch) | |
tree | e174834a5aaf50b0444f829e8a2cfd678e833455 /lib/api/snippets.rb | |
parent | bc20fa9b02d5fea8f5781b6397af10f006983111 (diff) | |
download | gitlab-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/snippets.rb')
-rw-r--r-- | lib/api/snippets.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/snippets.rb b/lib/api/snippets.rb index c5e55a5df4f..b93fdc62808 100644 --- a/lib/api/snippets.rb +++ b/lib/api/snippets.rb @@ -64,7 +64,7 @@ module API desc: 'The visibility of the snippet' end post do - attrs = map_visibility_level(declared_params(include_missing: false)).merge(request: request, api: true) + attrs = declared_params(include_missing: false).merge(request: request, api: true) snippet = CreateSnippetService.new(nil, current_user, attrs).execute render_spam_error! if snippet.spam? @@ -95,7 +95,7 @@ module API return not_found!('Snippet') unless snippet authorize! :update_personal_snippet, snippet - attrs = map_visibility_level(declared_params(include_missing: false).merge(request: request, api: true)) + attrs = declared_params(include_missing: false).merge(request: request, api: true) UpdateSnippetService.new(nil, current_user, snippet, attrs).execute |