summaryrefslogtreecommitdiff
path: root/app/presenters
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-03-24 11:11:36 +0100
committerJarka Kadlecova <jarka@gitlab.com>2017-03-24 11:53:47 +0100
commite0dc73527a478188cfa28b456b64798639aa73c9 (patch)
tree005fa0bf10994020294e423752f289304c5fc83a /app/presenters
parent8f6608af65563916897ebdda3c274270c969d604 (diff)
downloadgitlab-ce-e0dc73527a478188cfa28b456b64798639aa73c9.tar.gz
Project deploy keys json end point
Diffstat (limited to 'app/presenters')
-rw-r--r--app/presenters/projects/settings/deploy_keys_presenter.rb11
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