Commit 900d30798b7eef1301978ff6f97b4cee7414b696
1 parent
aea79b80
Exists in
spb-stable
and in
2 other branches
Use new Projects::TransferService class
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
6 additions
and
4 deletions
Show diff stats
app/controllers/projects_controller.rb
| ... | ... | @@ -44,7 +44,7 @@ class ProjectsController < ApplicationController |
| 44 | 44 | end |
| 45 | 45 | |
| 46 | 46 | def transfer |
| 47 | - ::Projects::TransferService.new(project, current_user, params).execute | |
| 47 | + ::Projects::TransferService.new(project, current_user, params[:project]).execute | |
| 48 | 48 | end |
| 49 | 49 | |
| 50 | 50 | def show | ... | ... |
lib/api/groups.rb
| ... | ... | @@ -87,10 +87,12 @@ module API |
| 87 | 87 | # POST /groups/:id/projects/:project_id |
| 88 | 88 | post ":id/projects/:project_id" do |
| 89 | 89 | authenticated_as_admin! |
| 90 | - @group = Group.find(params[:id]) | |
| 90 | + group = Group.find(params[:id]) | |
| 91 | 91 | project = Project.find(params[:project_id]) |
| 92 | - if project.transfer(@group) | |
| 93 | - present @group | |
| 92 | + result = ::Projects::TransferService.new(project, current_user, namespace_id: group.id).execute | |
| 93 | + | |
| 94 | + if result | |
| 95 | + present group | |
| 94 | 96 | else |
| 95 | 97 | not_found! |
| 96 | 98 | end | ... | ... |