mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 12:17:30 +02:00
updated api response
This commit is contained in:
parent
ece988fca1
commit
cc07350551
2 changed files with 4 additions and 4 deletions
|
@ -8,8 +8,8 @@ module Api
|
||||||
@contact = Contact.find_by(code: params[:id])
|
@contact = Contact.find_by(code: params[:id])
|
||||||
|
|
||||||
if @contact
|
if @contact
|
||||||
render json: { contact: Serializers::Repp::Contact.new(@contact,
|
render json: { code: 1000, contact: Serializers::Repp::Contact.new(@contact,
|
||||||
show_address: false).to_json },
|
show_address: false).to_json },
|
||||||
status: :found
|
status: :found
|
||||||
else
|
else
|
||||||
render json: { errors: 'Contact not found' }, status: :not_found
|
render json: { errors: 'Contact not found' }, status: :not_found
|
||||||
|
|
|
@ -8,8 +8,8 @@ module Api
|
||||||
@domain = Domain.find_by(name: params[:name])
|
@domain = Domain.find_by(name: params[:name])
|
||||||
|
|
||||||
if @domain
|
if @domain
|
||||||
render json: { domain: Serializers::Repp::Domain.new(@domain,
|
render json: { code: 1000, domain: Serializers::Repp::Domain.new(@domain,
|
||||||
sponsored: true).to_json },
|
sponsored: true).to_json },
|
||||||
status: :found
|
status: :found
|
||||||
else
|
else
|
||||||
render json: { errors: 'Domain not found' }, status: :not_found
|
render json: { errors: 'Domain not found' }, status: :not_found
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue