diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-08-05 11:35:44 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-08-05 11:38:17 +0200 |
commit | 554e18ab025fcd86001faa57fab14fe3ca28a672 (patch) | |
tree | c50c0e8a1e5d41fdbbda5f3e530d128bca01cd22 /lib/api | |
parent | 460065b743a5f28d92bda71b0e778b01cd369d80 (diff) | |
download | gitlab-ce-554e18ab025fcd86001faa57fab14fe3ca28a672.tar.gz |
Create service for enabling deploy keys
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/deploy_keys.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/deploy_keys.rb b/lib/api/deploy_keys.rb index 52f89373ad3..6dc9beb57ec 100644 --- a/lib/api/deploy_keys.rb +++ b/lib/api/deploy_keys.rb @@ -76,12 +76,12 @@ module API requires :key_id, type: Integer, desc: 'The ID of the deploy key' end post ":id/#{path}/:key_id/enable" do - key = DeployKey.find(params[:key_id]) + key = EnableDeployKeyService.new(user_project, current_user, declared(params)).execute - if user_project.deploy_keys << key + if key present key, with: Entities::SSHKey else - render_validation_error!(key) + not_found!('Deploy Key') end end |