Class: Api::Vendor::V1::CitiesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/api/vendor/v1/cities_controller.rb

Constant Summary collapse

MINIMUM_RESTAURANTS_COUNT =
10

Constants inherited from BaseController

BaseController::CACHE_NAMESPACE

Instance Attribute Summary

Attributes inherited from BaseController

#vendor

Instance Method Summary collapse

Methods included from LogrageCustomLogger

#append_info_to_payload

Methods included from ResponseCacheConcern

#my_response_cache

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
# File 'app/controllers/api/vendor/v1/cities_controller.rb', line 5

def index
  my_response_cache(cities_cache_key, :json, public: true) do
    cities = fetch_cities_with_minimum_restaurants

    serialized_cities = CitySerializer.new(cities)
    serialized_cities.as_json.merge(success: true, message: nil)
  end
end