mirror of
https://github.com/internetee/registry.git
synced 2025-06-02 02:38:35 +02:00
21 lines
646 B
Ruby
21 lines
646 B
Ruby
require 'serializers/repp/contact'
|
|
|
|
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: { code: 1000, 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
|