mirror of
https://github.com/internetee/registry.git
synced 2025-07-31 15:06:23 +02:00
Fixed codeclimate issues
This commit is contained in:
parent
885206d075
commit
f8ef0502a5
1 changed files with 4 additions and 2 deletions
|
@ -1,9 +1,10 @@
|
||||||
require 'serializers/repp/invoice'
|
require 'serializers/repp/invoice'
|
||||||
module Repp
|
module Repp
|
||||||
module V1
|
module V1
|
||||||
class InvoicesController < BaseController
|
class InvoicesController < BaseController # rubocop:disable Metrics/ClassLength
|
||||||
load_and_authorize_resource
|
load_and_authorize_resource
|
||||||
|
|
||||||
|
# rubocop:disable Metrics/MethodLength
|
||||||
api :get, '/repp/v1/invoices'
|
api :get, '/repp/v1/invoices'
|
||||||
desc 'Get all invoices'
|
desc 'Get all invoices'
|
||||||
def index
|
def index
|
||||||
|
@ -18,6 +19,7 @@ module Repp
|
||||||
render_success(data: { invoices: serialized_invoices(limited_invoices),
|
render_success(data: { invoices: serialized_invoices(limited_invoices),
|
||||||
count: invoices.count })
|
count: invoices.count })
|
||||||
end
|
end
|
||||||
|
# rubocop:enable Metrics/MethodLength
|
||||||
|
|
||||||
api :get, '/repp/v1/invoices/:id'
|
api :get, '/repp/v1/invoices/:id'
|
||||||
desc 'Get a specific invoice'
|
desc 'Get a specific invoice'
|
||||||
|
@ -43,7 +45,7 @@ module Repp
|
||||||
end
|
end
|
||||||
def send_to_recipient
|
def send_to_recipient
|
||||||
recipient = invoice_params[:recipient]
|
recipient = invoice_params[:recipient]
|
||||||
unless recipient.present?
|
if recipient.blank?
|
||||||
handle_non_epp_errors(@invoice, 'Invoice recipient cannot be empty')
|
handle_non_epp_errors(@invoice, 'Invoice recipient cannot be empty')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue