updated api response

This commit is contained in:
Oleg Hasjanov 2021-08-27 14:12:16 +03:00 committed by olegphenomenon
parent ece988fca1
commit cc07350551
2 changed files with 4 additions and 4 deletions

View file

@ -8,8 +8,8 @@ module Api
@contact = Contact.find_by(code: params[:id])
if @contact
render json: { contact: Serializers::Repp::Contact.new(@contact,
show_address: false).to_json },
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

View file

@ -8,8 +8,8 @@ module Api
@domain = Domain.find_by(name: params[:name])
if @domain
render json: { domain: Serializers::Repp::Domain.new(@domain,
sponsored: true).to_json },
render json: { code: 1000, domain: Serializers::Repp::Domain.new(@domain,
sponsored: true).to_json },
status: :found
else
render json: { errors: 'Domain not found' }, status: :not_found