Commit d3cc857c authored by Nick Thomas's avatar Nick Thomas

Rename the EE-only `API::Entities::License` to `API:Entities::GitlabLicense`

The CE->EE merge renamed `RepoLicense` to `License`. It's easier to rename
the EE-only code than to try to sort it out.
parent 6b79ed9d
...@@ -865,7 +865,7 @@ module API ...@@ -865,7 +865,7 @@ module API
end end
end end
class License < Grape::Entity class GitlabLicense < Grape::Entity
expose :starts_at, :expires_at, :licensee, :add_ons expose :starts_at, :expires_at, :licensee, :add_ons
expose :user_limit do |license, options| expose :user_limit do |license, options|
......
...@@ -4,16 +4,16 @@ module API ...@@ -4,16 +4,16 @@ module API
resource :license do resource :license do
desc 'Get information on the currently active license' do desc 'Get information on the currently active license' do
success Entities::License success Entities::GitlabLicense
end end
get do get do
license = ::License.current license = ::License.current
present license, with: Entities::License present license, with: Entities::GitlabLicense
end end
desc 'Add a new license' do desc 'Add a new license' do
success Entities::License success Entities::GitlabLicense
end end
params do params do
requires :license, type: String, desc: 'The license text' requires :license, type: String, desc: 'The license text'
...@@ -21,7 +21,7 @@ module API ...@@ -21,7 +21,7 @@ module API
post do post do
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::GitlabLicense
else else
render_api_error!(license.errors.full_messages.first, 400) render_api_error!(license.errors.full_messages.first, 400)
end end
......
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