diff --git a/app/controllers/api/v1/account_by_username_controller.rb b/app/controllers/api/v1/account_by_username_controller.rb index 30964101..5246f800 100644 --- a/app/controllers/api/v1/account_by_username_controller.rb +++ b/app/controllers/api/v1/account_by_username_controller.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class Api::V1::AccountByUsernameController < Api::BaseController +class Api::V1::AccountByUsernameController < EmptyController before_action :set_account before_action :check_account_suspension before_action :check_account_local diff --git a/app/controllers/api/v1/custom_emojis_controller.rb b/app/controllers/api/v1/custom_emojis_controller.rb index 1bb19a09..3589d1e3 100644 --- a/app/controllers/api/v1/custom_emojis_controller.rb +++ b/app/controllers/api/v1/custom_emojis_controller.rb @@ -1,13 +1,8 @@ # frozen_string_literal: true -class Api::V1::CustomEmojisController < Api::BaseController - respond_to :json - - skip_before_action :set_cache_headers - +class Api::V1::CustomEmojisController < EmptyController def index - render_cached_json('api:v1:custom_emojis', expires_in: 1.minute) do - ActiveModelSerializers::SerializableResource.new(CustomEmoji.local.where(disabled: false), each_serializer: REST::CustomEmojiSerializer) - end + data = ActiveModelSerializers::SerializableResource.new(CustomEmoji.local.where(disabled: false), each_serializer: REST::CustomEmojiSerializer) + render json: data.to_json, content_type: 'application/json' end end diff --git a/app/controllers/api/v1/gab_trends_controller.rb b/app/controllers/api/v1/gab_trends_controller.rb index bcf32294..166403bb 100644 --- a/app/controllers/api/v1/gab_trends_controller.rb +++ b/app/controllers/api/v1/gab_trends_controller.rb @@ -1,10 +1,6 @@ # frozen_string_literal: true -class Api::V1::GabTrendsController < Api::BaseController - respond_to :json - - skip_before_action :set_cache_headers - +class Api::V1::GabTrendsController < EmptyController def index if Rails.env != 'development' render json: nil diff --git a/app/controllers/api/v1/group_categories_controller.rb b/app/controllers/api/v1/group_categories_controller.rb index 0496da62..f554e374 100644 --- a/app/controllers/api/v1/group_categories_controller.rb +++ b/app/controllers/api/v1/group_categories_controller.rb @@ -1,15 +1,10 @@ # frozen_string_literal: true -class Api::V1::GroupCategoriesController < Api::BaseController - # respond_to :json - - before_action :require_user! - skip_before_action :set_cache_headers +class Api::V1::GroupCategoriesController < EmptyController def index - render_cached_json('api:v1:group_categories', expires_in: 1.minute) do - ActiveModelSerializers::SerializableResource.new(GroupCategories.all, each_serializer: REST::GroupCategoriesSerializer) - end + data = ActiveModelSerializers::SerializableResource.new(GroupCategories.all, each_serializer: REST::GroupCategoriesSerializer) + render json: data.to_json, content_type: 'application/json' end end diff --git a/app/controllers/api/v1/shop_controller.rb b/app/controllers/api/v1/shop_controller.rb index 452ad44a..32984e53 100644 --- a/app/controllers/api/v1/shop_controller.rb +++ b/app/controllers/api/v1/shop_controller.rb @@ -1,13 +1,11 @@ # frozen_string_literal: true -class Api::V1::ShopController < Api::BaseController - before_action :require_user! - - respond_to :json - - skip_before_action :set_cache_headers - +class Api::V1::ShopController < EmptyController def index + if Rails.env != 'development' + render json: nil + end + type = params[:type] if type == 'featured_products' body = Redis.current.get("gabstore:featuredproducts") diff --git a/app/controllers/manifests_controller.rb b/app/controllers/manifests_controller.rb index 332d845d..2b8ab280 100644 --- a/app/controllers/manifests_controller.rb +++ b/app/controllers/manifests_controller.rb @@ -1,7 +1,6 @@ # frozen_string_literal: true -class ManifestsController < ApplicationController - skip_before_action :store_current_location +class ManifestsController < EmptyController def show render json: InstancePresenter.new, serializer: ManifestSerializer