mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Refactor domain transfer controller
This commit is contained in:
parent
b91f9b1a8e
commit
d056d370be
3 changed files with 42 additions and 25 deletions
|
@ -385,6 +385,23 @@ class Epp::Domain < Domain
|
|||
|
||||
### TRANSFER ###
|
||||
|
||||
# rubocop: disable Metrics/PerceivedComplexity
|
||||
# rubocop: disable Metrics/CyclomaticComplexity
|
||||
def transfer(frame, action, current_user)
|
||||
case action
|
||||
when 'query'
|
||||
return pending_transfer if pending_transfer
|
||||
return query_transfer(frame, current_user)
|
||||
when 'approve'
|
||||
return approve_transfer(frame, current_user) if pending_transfer
|
||||
when 'reject'
|
||||
return reject_transfer(frame, current_user) if pending_transfer
|
||||
end
|
||||
add_epp_error('2303', nil, nil, I18n.t('pending_transfer_was_not_found'))
|
||||
end
|
||||
# rubocop: enable Metrics/PerceivedComplexity
|
||||
# rubocop: enable Metrics/CyclomaticComplexity
|
||||
|
||||
# rubocop: disable Metrics/MethodLength
|
||||
def query_transfer(frame, current_user)
|
||||
return false unless can_be_transferred_to?(current_user.registrar)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue