diff options
author | Jarka Kadlecova <jarka@gitlab.com> | 2017-03-24 13:11:36 +0300 |
---|---|---|
committer | Jarka Kadlecova <jarka@gitlab.com> | 2017-03-24 13:53:47 +0300 |
commit | e0dc73527a478188cfa28b456b64798639aa73c9 (patch) | |
tree | 005fa0bf10994020294e423752f289304c5fc83a /app/presenters/projects | |
parent | 8f6608af65563916897ebdda3c274270c969d604 (diff) |
Project deploy keys json end point
Diffstat (limited to 'app/presenters/projects')
-rw-r--r-- | app/presenters/projects/settings/deploy_keys_presenter.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/presenters/projects/settings/deploy_keys_presenter.rb b/app/presenters/projects/settings/deploy_keys_presenter.rb index 86ac513b3c0..070b0c35e36 100644 --- a/app/presenters/projects/settings/deploy_keys_presenter.rb +++ b/app/presenters/projects/settings/deploy_keys_presenter.rb @@ -48,6 +48,17 @@ module Projects available_public_keys.any? end + def as_json + serializer = DeployKeySerializer.new + opts = { user: current_user } + + { + enabled_keys: serializer.represent(enabled_keys, opts), + available_project_keys: serializer.represent(available_project_keys, opts), + public_keys: serializer.represent(available_public_keys, opts) + } + end + def to_partial_path 'projects/deploy_keys/index' end |