mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Basic contact delete command implementation
This commit is contained in:
parent
1645b3e96f
commit
65bb5166cc
7 changed files with 65 additions and 1 deletions
|
@ -22,4 +22,22 @@ module Epp::ContactsHelper
|
|||
@contact.save
|
||||
render '/epp/contacts/create'
|
||||
end
|
||||
|
||||
def delete_contact
|
||||
ph = params_hash['epp']['command']['delete']['delete']
|
||||
|
||||
begin
|
||||
@contact = Contact.where(code: ph[:id]).first
|
||||
@contact.destroy
|
||||
render '/epp/contacts/delete'
|
||||
rescue NoMethodError => e
|
||||
@code = '2303'
|
||||
@msg = "Object does not exist"
|
||||
render '/epp/error'
|
||||
rescue
|
||||
@code = '2400'
|
||||
@msg = "Command failed"
|
||||
render '/epp/error'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue