Basic contact delete command implementation

This commit is contained in:
Andres Keskküla 2014-07-28 12:00:55 +03:00
parent 1645b3e96f
commit 65bb5166cc
7 changed files with 65 additions and 1 deletions

View file

@ -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