mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
Merge remote-tracking branch 'origin/master' into 269-dispute-list
This commit is contained in:
commit
7ef15a5bf1
15 changed files with 448 additions and 36 deletions
|
@ -3,9 +3,10 @@ class Registrant::ContactsController < RegistrantController
|
|||
helper_method :fax_enabled?
|
||||
helper_method :domain_filter_params
|
||||
skip_authorization_check only: %i[edit update]
|
||||
before_action :set_contact, only: [:show]
|
||||
|
||||
def show
|
||||
@contact = current_user_contacts.find(params[:id])
|
||||
@requester_contact = Contact.find_by(ident: current_registrant_user.ident).id
|
||||
authorize! :read, @contact
|
||||
end
|
||||
|
||||
|
@ -30,6 +31,13 @@ class Registrant::ContactsController < RegistrantController
|
|||
|
||||
private
|
||||
|
||||
def set_contact
|
||||
id = params[:id]
|
||||
contact = domain.contacts.find_by(id: id) || current_user_contacts.find_by(id: id)
|
||||
contact ||= Contact.find_by(id: id, ident: domain.registrant.ident)
|
||||
@contact = contact
|
||||
end
|
||||
|
||||
def domain
|
||||
current_user_domains.find(params[:domain_id])
|
||||
end
|
||||
|
|
23
app/controllers/repp/v1/auctions_controller.rb
Normal file
23
app/controllers/repp/v1/auctions_controller.rb
Normal file
|
@ -0,0 +1,23 @@
|
|||
module Repp
|
||||
module V1
|
||||
class AuctionsController < ActionController::API
|
||||
def index
|
||||
auctions = Auction.started
|
||||
|
||||
render json: { count: auctions.count,
|
||||
auctions: auctions_to_json(auctions) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def auctions_to_json(auctions)
|
||||
auctions.map do |e|
|
||||
{
|
||||
domain_name: e.domain,
|
||||
punycode_domain_name: SimpleIDN.to_ascii(e.domain),
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
15
app/controllers/repp/v1/retained_domains_controller.rb
Normal file
15
app/controllers/repp/v1/retained_domains_controller.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module Repp
|
||||
module V1
|
||||
class RetainedDomainsController < ActionController::API
|
||||
def index
|
||||
domains = RetainedDomains.new(query_params)
|
||||
|
||||
render json: { count: domains.count, domains: domains.to_jsonable }
|
||||
end
|
||||
|
||||
def query_params
|
||||
params.permit(:type)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue