mirror of
https://github.com/internetee/registry.git
synced 2025-07-05 10:43:32 +02:00
Add domain deleting support
This commit is contained in:
parent
a9df2c82b1
commit
08a4650f4a
5 changed files with 40 additions and 11 deletions
|
@ -68,6 +68,15 @@ module Epp::DomainsHelper
|
|||
render '/epp/domains/transfer'
|
||||
end
|
||||
|
||||
def delete_domain
|
||||
@domain = find_domain
|
||||
|
||||
handle_errors(@domain) and return unless @domain
|
||||
handle_errors(@domain) and return unless @domain.destroy
|
||||
|
||||
render '/epp/domains/success'
|
||||
end
|
||||
|
||||
### HELPER METHODS ###
|
||||
|
||||
private
|
||||
|
@ -127,6 +136,12 @@ module Epp::DomainsHelper
|
|||
xml_attrs_present?(@ph, [['name']])
|
||||
end
|
||||
|
||||
## DELETE
|
||||
def validate_domain_delete_request
|
||||
@ph = params_hash['epp']['command']['delete']['delete']
|
||||
xml_attrs_present?(@ph, [['name']])
|
||||
end
|
||||
|
||||
## SHARED
|
||||
def find_domain(secure = { secure: true })
|
||||
domain = Domain.find_by(name: @ph[:name], registrar: current_epp_user.registrar) if secure[:secure] == true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue