Class: Spree::Api::V2::Storefront::CheckInsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/spree/api/v2/storefront/check_ins_controller.rb', line 13

def create
  spree_authorize! :create, SpreeCmCommissioner::CheckIn

  check_in = spree_current_user.check_ins.build(check_in_attributes)

  if check_in.save
    render_serialized_payload { serialize_resource(check_in) }
  else
    render_error_payload(check_in.errors.full_messages.to_sentence)
  end
end

#showObject



8
9
10
11
# File 'app/controllers/spree/api/v2/storefront/check_ins_controller.rb', line 8

def show
  spree_authorize! :show, resource
  super
end