Commit 6c32fc56 authored by Robert Schilling's avatar Robert Schilling

Grapify the license API

parent cf046802
...@@ -3,26 +3,22 @@ module API ...@@ -3,26 +3,22 @@ module API
before { authenticated_as_admin! } before { authenticated_as_admin! }
resource :license do resource :license do
# Get information on the currently active license desc 'Get information on the currently active license' do
# success Entities::License
# Example request: end
# GET /license
get do get do
license = ::License.current license = ::License.current
present license, with: Entities::License present license, with: Entities::License
end end
# Add a new license desc 'Add a new license' do
# success Entities::License
# Parameters: end
# license (required) - The license text params do
# requires :license, type: String, desc: 'The license text'
# Example request: end
# POST /license
post do post do
required_attributes! [:license]
license = ::License.new(data: params[:license]) license = ::License.new(data: params[:license])
if license.save if license.save
present license, with: Entities::License present license, with: Entities::License
......
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