Class: Api::V5::ServiceTypesController
- Inherits:
-
BaseController
- Object
- ActionController::API
- BaseController
- Api::V5::ServiceTypesController
- Defined in:
- app/controllers/api/v5/service_types_controller.rb
Overview
typed: ignore frozen_string_literal: true
Constant Summary
Constants inherited from BaseController
BaseController::CACHE_NAMESPACE, BaseController::INTERNAL_SERVER_ERROR_MESSAGE, BaseController::ResponseSchema
Instance Method Summary collapse
Methods inherited from BaseController
Methods included from LogrageCustomLogger
Methods included from ResponseCacheConcern
Instance Method Details
#index ⇒ Object
5 6 7 8 9 10 |
# File 'app/controllers/api/v5/service_types_controller.rb', line 5 def index service_types = ServiceType.joins(:city_service_types).where(city_service_types: { city_id: params[:city_id] }) expires_in DEFAULT_HTTP_PUBLIC_CACHE_EXPIRATION, public: true render json: service_types, each_serializer: Api::V5::ServiceTypeSerializer, adapter: :json_api end |