Use new Projects::TransferService class

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-05-28 19:03:45 +03:00
parent aea79b8035
commit 900d30798b
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
2 changed files with 6 additions and 4 deletions

View file

@ -44,7 +44,7 @@ class ProjectsController < ApplicationController
end
def transfer
::Projects::TransferService.new(project, current_user, params).execute
::Projects::TransferService.new(project, current_user, params[:project]).execute
end
def show

View file

@ -87,10 +87,12 @@ module API
# POST /groups/:id/projects/:project_id
post ":id/projects/:project_id" do
authenticated_as_admin!
@group = Group.find(params[:id])
group = Group.find(params[:id])
project = Project.find(params[:project_id])
if project.transfer(@group)
present @group
result = ::Projects::TransferService.new(project, current_user, namespace_id: group.id).execute
if result
present group
else
not_found!
end