Updated contact#update request validation

This commit is contained in:
Andres Keskküla 2014-08-26 16:04:59 +03:00
parent 7b750b7d9b
commit 3b7289607c
2 changed files with 12 additions and 3 deletions

View file

@ -61,6 +61,7 @@ module Epp
## UPDATE
def validate_contact_update_request
@ph = params_hash['epp']['command']['update']['update']
update_attrs_present?
xml_attrs_present?(@ph, [['id']])
end
@ -70,6 +71,13 @@ module Epp
value: { obj: 'id', val: code } }
end
def update_attrs_present?
return true if parsed_frame.css('add').present?
return true if parsed_frame.css('rem').present?
return true if parsed_frame.css('chg').present?
epp_errors << { code: '2003', msg: I18n.t('errors.messages.required_parameter_missing', key: 'add, rem or chg') }
end
## DELETE
def validate_contact_delete_request
@ph = params_hash['epp']['command']['delete']['delete']