Add show action

This commit is contained in:
Maciej Szlosarczyk 2018-07-27 11:00:35 +03:00
parent 0ab9f6333f
commit b33ad0d4e8
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
4 changed files with 28 additions and 8 deletions

View file

@ -4,12 +4,15 @@ module Api
module V1
module Registrant
class DomainsController < ActionController::API
def index
render json: { success: true }
end
def show
render json: { success: true }
@domain = Domain.find_by(uuid: params[:uuid])
if @domain
render json: @domain
else
render json: { errors: ["Domain not found"] }, status: :not_found
end
end
end
end