diff --git a/app/controllers/repp/v1/domains_controller.rb b/app/controllers/repp/v1/domains_controller.rb index ed86638e4..5c7189246 100644 --- a/app/controllers/repp/v1/domains_controller.rb +++ b/app/controllers/repp/v1/domains_controller.rb @@ -7,6 +7,7 @@ module Repp before_action :validate_registrar_authorization, only: %i[transfer_info destroy] before_action :forward_registrar_id, only: %i[create update destroy] before_action :set_domain, only: %i[update] + before_action :transaform_period_value_to_integer, only: %i[create] THROTTLED_ACTIONS = %i[transfer_info transfer index create show update destroy].freeze include Shunter::Integration::Throttle @@ -257,6 +258,10 @@ module Repp modify_contact_params(dup_params) end + def transaform_period_value_to_integer + params[:domain][:period] = params[:domain][:period].to_i + end + def modify_contact_params(params) new_contact_params = params[:contacts].map { |c| c.to_h.symbolize_keys } old_contact_params = @domain.domain_contacts.includes(:contact).map do |c|