diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-04-25 08:44:38 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2019-04-25 08:44:38 +0000 |
commit | 77efa66cdf17740e28e996cdfee3a3a8d7b19ef4 (patch) | |
tree | fde733d87a2317dc3df040b9f10533a600774bd6 /lib | |
parent | 97678c09fd919b3fb2240dbe4d2a063a54780e55 (diff) | |
parent | c563e29fb37c482951c17680c7e34bfbfafa4ca0 (diff) | |
download | gitlab-ce-77efa66cdf17740e28e996cdfee3a3a8d7b19ef4.tar.gz |
Merge branch 'get-rid-of-user-namespace-method' into 'master'
Get rid of the user_namespace API helper method
See merge request gitlab-org/gitlab-ce!27636
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/helpers.rb | 4 | ||||
-rw-r--r-- | lib/api/namespaces.rb | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 8a21d44b4bf..7e4539d0419 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -67,10 +67,6 @@ module API initial_current_user != current_user end - def user_namespace - @user_namespace ||= find_namespace!(params[:id]) - end - def user_group @group ||= find_group!(params[:id]) end diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb index 3cc09f6ac3f..77ecb3e7cde 100644 --- a/lib/api/namespaces.rb +++ b/lib/api/namespaces.rb @@ -44,6 +44,8 @@ module API requires :id, type: String, desc: "Namespace's ID or path" end get ':id', requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do + user_namespace = find_namespace!(params[:id]) + present user_namespace, with: Entities::Namespace, current_user: current_user end end |