Class: Spree::Api::V2::Operator::CheckInsController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Spree::Api::V2::Operator::CheckInsController
- Defined in:
- app/controllers/spree/api/v2/operator/check_ins_controller.rb
Instance Method Summary collapse
Instance Method Details
#collection ⇒ Object
8 9 10 11 12 |
# File 'app/controllers/spree/api/v2/operator/check_ins_controller.rb', line 8 def collection @collection = SpreeCmCommissioner::CheckIn.where(checkinable: params[:taxon_id]) @collection = @collection.page(params[:page]).per(params[:per_page]) end |
#create ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/spree/api/v2/operator/check_ins_controller.rb', line 14 def create :create, model_class context = SpreeCmCommissioner::CheckInBulkCreator.call( check_ins_attributes: [{ guest_id: params[:guest_id] }], check_in_by: spree_current_user ) if context.success? render_serialized_payload(201) { serialize_resource(context.check_ins[0]) } else render_error_payload(context.) end end |