Fix CC issues

This commit is contained in:
Karl Erik Õunapuu 2021-01-28 12:47:06 +02:00
parent 7c35083a8b
commit dd8d4c1085
No known key found for this signature in database
GPG key ID: C9DD647298A34764
6 changed files with 12 additions and 12 deletions

View file

@ -12,9 +12,9 @@ plugins:
duplication:
enabled: true
config:
count_threshold: 3
languages:
ruby:
mass_threshold: 26
- ruby
- javascript
eslint:
enabled: true

View file

@ -38,7 +38,7 @@ module Repp
end
def cta(action = 'add')
contact_create_params[:contacts].each { |c| c[:action] = action }
params[:contacts].each { |c| c[:action] = action }
action = Actions::DomainUpdate.new(@domain, contact_create_params, current_user)
# rubocop:disable Style/AndOr
@ -76,7 +76,7 @@ module Repp
private
def contact_create_params
params.permit!
params.permit(:domain_id, contacts: [%i[action code type]])
end
def contact_params

View file

@ -37,8 +37,8 @@ module Repp
end
def cta(action = 'add')
dnssec_params[:dnssec][:dns_keys].each { |n| n[:action] = action }
action = Actions::DomainUpdate.new(@domain, dnssec_params[:dnssec], current_user)
params[:dns_keys].each { |n| n[:action] = action }
action = Actions::DomainUpdate.new(@domain, dnssec_params, current_user)
# rubocop:disable Style/AndOr
(handle_errors(@domain) and return) unless action.call
@ -50,7 +50,7 @@ module Repp
private
def dnssec_params
params.permit!
params.permit(:domain_id, dns_keys: [%i[action flags protocol alg public_key]])
end
end
end

View file

@ -13,8 +13,8 @@ module Repp
param :ipv6, Array, required: false, desc: 'Array of IPv6 values'
end
def create
nameserver_params[:nameservers].each { |n| n[:action] = 'add' }
action = Actions::DomainUpdate.new(@domain, params, current_user)
params[:nameservers].each { |n| n[:action] = 'add' }
action = Actions::DomainUpdate.new(@domain, nameserver_params, current_user)
unless action.call
handle_errors(@domain)
@ -45,7 +45,7 @@ module Repp
end
def nameserver_params
params.permit!
params.permit(:domain_id, nameservers: [[:hostname, :action, ipv4: [], ipv6: []]])
end
end
end

View file

@ -36,7 +36,7 @@ module Repp
private
def renew_params
params.permit!
params.permit(:domain_id, renew: %i[period period_unit])
end
def validate_renew_period

View file

@ -31,7 +31,7 @@ module Repp
end
def transfer_params
params.permit!
params.permit(:domain_id, transfer: [:transfer_code])
end
end
end