Commit c83af0df authored by Alex Denisov's avatar Alex Denisov

Uses attributes_for_keys

parent b6c6a5b1
...@@ -26,10 +26,8 @@ module Gitlab ...@@ -26,10 +26,8 @@ module Gitlab
# Example Request: # Example Request:
# POST /keys # POST /keys
post do post do
key = current_user.keys.new( attrs = attributes_for_keys [:title, :key]
title: params[:title], key = current_user.keys.new attrs
key: params[:key]
)
if key.save if key.save
present key, with: Entities::Key present key, with: Entities::Key
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment