Class: Spree::Api::V2::Tenant::TripSearchController
- Inherits:
-
BaseController
- Object
- ResourceController
- BaseController
- Spree::Api::V2::Tenant::TripSearchController
- Defined in:
- app/controllers/spree/api/v2/tenant/trip_search_controller.rb
Constant Summary collapse
- CACHE_EXPIRES_IN =
5.minutes
Instance Method Summary collapse
Methods inherited from BaseController
#render_serialized_payload, #require_tenant, #scope
Instance Method Details
#index ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/spree/api/v2/tenant/trip_search_controller.rb', line 8 def index render_serialized_payload do Rails.cache.fetch(collection_cache_key, collection_cache_opts) do trips = SpreeCmCommissioner::TripQuery.new( origin_id: params[:origin_id], destination_id: params[:destination_id], date: params[:date], route_type: params[:route_type], number_of_guests: params[:number_of_guests], tenant_id: @tenant.id, params: params ).call serialize_collection(trips) end end end |