mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
added api for accr center
This commit is contained in:
parent
bccd3d51c1
commit
a87fd6a8b7
8 changed files with 191 additions and 0 deletions
|
@ -0,0 +1,20 @@
|
|||
require 'serializers/repp/domain'
|
||||
|
||||
module Api
|
||||
module V1
|
||||
module AccreditationCenter
|
||||
class DomainsController < ::Api::V1::AccreditationCenter::BaseController
|
||||
def show
|
||||
@domain = Domain.find_by(name: params[:name])
|
||||
|
||||
if @domain
|
||||
render json: { domain: Serializers::Repp::Domain.new(@domain,
|
||||
sponsored: true).to_json }, status: :found
|
||||
else
|
||||
render json: { errors: 'Domain not found' }, status: :not_found
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue