added api for accr center

This commit is contained in:
Oleg Hasjanov 2021-08-26 18:22:19 +03:00 committed by olegphenomenon
parent bccd3d51c1
commit a87fd6a8b7
8 changed files with 191 additions and 0 deletions

View file

@ -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