Class: Spree::Api::V2::Storefront::AccountCheckerController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/api/v2/storefront/account_checker_controller.rb

Instance Method Summary collapse

Instance Method Details

#filter_paramsObject



16
17
18
# File 'app/controllers/spree/api/v2/storefront/account_checker_controller.rb', line 16

def filter_params
  params.permit(:login, :locale, :format)
end

#indexObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/spree/api/v2/storefront/account_checker_controller.rb', line 6

def index
  checker = SpreeCmCommissioner::ExistingAccountChecker.call(filter_params.to_h)

  if checker.success?
    head :ok
  else
    render_error_payload(checker.message)
  end
end