Uses attributes_for_keys
This commit is contained in:
parent
b6c6a5b159
commit
c83af0dfe7
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue