Uses attributes_for_keys
This commit is contained in:
parent
b6c6a5b159
commit
c83af0dfe7
|
@ -26,10 +26,8 @@ module Gitlab
|
|||
# Example Request:
|
||||
# POST /keys
|
||||
post do
|
||||
key = current_user.keys.new(
|
||||
title: params[:title],
|
||||
key: params[:key]
|
||||
)
|
||||
attrs = attributes_for_keys [:title, :key]
|
||||
key = current_user.keys.new attrs
|
||||
if key.save
|
||||
present key, with: Entities::Key
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue