mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Repp: Add contacts/check action
This commit is contained in:
parent
1686c352bc
commit
39c6d20413
2 changed files with 25 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
module Repp
|
||||
module V1
|
||||
class ContactsController < BaseController
|
||||
before_action :find_contact, only: [:update]
|
||||
before_action :find_contact, only: %i[show update]
|
||||
|
||||
## GET /repp/v1/contacts
|
||||
def index
|
||||
|
@ -20,6 +20,24 @@ module Repp
|
|||
render(json: resp, status: :ok)
|
||||
end
|
||||
|
||||
## GET /repp/v1/contacts/1
|
||||
def show
|
||||
render(json: @contact.as_json, status: :ok)
|
||||
end
|
||||
|
||||
## GET /repp/v1/contacts/check/1
|
||||
def check
|
||||
contact = Epp::Contact.find_by(code: params[:id])
|
||||
|
||||
render json: {
|
||||
code: 1000, message: I18n.t('epp.contacts.completed'),
|
||||
data: { contact: {
|
||||
id: params[:id],
|
||||
available: contact.nil?
|
||||
} }
|
||||
}, status: :ok
|
||||
end
|
||||
|
||||
## POST /repp/v1/contacts
|
||||
def create
|
||||
@legal_doc = params[:legal_documents]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue