Fix CC issues

This commit is contained in:
Alex Sherman 2021-05-05 17:31:13 +05:00
parent d4dc39bf22
commit 11d97358c1
16 changed files with 78 additions and 60 deletions

View file

@ -63,7 +63,7 @@ module Repp
@epp_errors ||= ActiveModel::Errors.new(self)
end
def handle_errors(obj = nil, update: false)
def handle_errors(obj = nil)
@epp_errors ||= ActiveModel::Errors.new(self)
if obj
@ -78,8 +78,8 @@ module Repp
@epp_errors ||= ActiveModel::Errors.new(self)
@epp_errors.add(:epp_errors, msg: 'Command failed', code: '2304') if data != {}
error_options = @epp_errors.errors.uniq.
select { |error| error.options[:code].present? }[0].options
error_options = @epp_errors.errors.uniq
.select { |error| error.options[:code].present? }[0].options
@response = { code: error_options[:code].to_i, message: error_options[:msg], data: data }
render(json: @response, status: status)