Class: Spree::Api::Chatrace::CheckInsController
- Inherits:
-
BaseController
- Object
- V2::BaseController
- BaseController
- Spree::Api::Chatrace::CheckInsController
- Defined in:
- app/controllers/spree/api/chatrace/check_ins_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/spree/api/chatrace/check_ins_controller.rb', line 9 def create context = SpreeCmCommissioner::CheckInBulkCreator.call(check_ins_attributes: [{ guest_id: guest.id }]) if context.success? render json: { checked_in_at: context.check_ins[0].confirmed_at }, status: :ok else render_error_payload(context.) end end |
#guest ⇒ Object
5 6 7 |
# File 'app/controllers/spree/api/chatrace/check_ins_controller.rb', line 5 def guest @guest ||= SpreeCmCommissioner::Guest.complete.find_by!(token: params[:guest_token]) end |