diff --git a/app/controllers/api/v1/categories_controller.rb b/app/controllers/api/v1/categories_controller.rb index 4ea26f393..3963a8912 100644 --- a/app/controllers/api/v1/categories_controller.rb +++ b/app/controllers/api/v1/categories_controller.rb @@ -2,7 +2,7 @@ module Api module V1 class CategoriesController < ApplicationController def index - categories = Category.all + categories = Category.all.arrange_serializable render json: categories, status: 200 end diff --git a/app/controllers/api/v1/search_controller.rb b/app/controllers/api/v1/search_controller.rb index ba8bfe2d8..b67c0e446 100644 --- a/app/controllers/api/v1/search_controller.rb +++ b/app/controllers/api/v1/search_controller.rb @@ -14,7 +14,7 @@ def index return unless stale?(etag: cache_key(locations), public: true) generate_pagination_headers(locations) - render json: locations.preload(tables), each_serializer: LocationsSerializer, status: 200 + render json: locations.uniq.preload(tables), each_serializer: LocationsSerializer, status: 200 end def nearby