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