mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 20:18:22 +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 ContactsController < ::Api::V1::AccreditationCenter::BaseController
|
||||
def show
|
||||
@contact = Contact.find_by(code: params[:id])
|
||||
|
||||
if @contact
|
||||
render json: { contact: Serializers::Repp::Contact.new(@contact,
|
||||
show_address: false).to_json }, status: :found
|
||||
else
|
||||
render json: { errors: 'Contact not found' }, status: :not_found
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue