Use new Projects::TransferService class

Signed-off-by: NDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
上级 aea79b80
...@@ -44,7 +44,7 @@ class ProjectsController < ApplicationController ...@@ -44,7 +44,7 @@ class ProjectsController < ApplicationController
end end
def transfer def transfer
::Projects::TransferService.new(project, current_user, params).execute ::Projects::TransferService.new(project, current_user, params[:project]).execute
end end
def show def show
......
...@@ -87,10 +87,12 @@ module API ...@@ -87,10 +87,12 @@ module API
# POST /groups/:id/projects/:project_id # POST /groups/:id/projects/:project_id
post ":id/projects/:project_id" do post ":id/projects/:project_id" do
authenticated_as_admin! authenticated_as_admin!
@group = Group.find(params[:id]) group = Group.find(params[:id])
project = Project.find(params[:project_id]) project = Project.find(params[:project_id])
if project.transfer(@group) result = ::Projects::TransferService.new(project, current_user, namespace_id: group.id).execute
present @group
if result
present group
else else
not_found! not_found!
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册