Updated some controllers to inherit from EmptyController
• Updated: - some controllers to inherit from EmptyController
This commit is contained in:
parent
7027cd0bf4
commit
297fac5d21
@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::AccountByUsernameController < Api::BaseController
|
class Api::V1::AccountByUsernameController < EmptyController
|
||||||
before_action :set_account
|
before_action :set_account
|
||||||
before_action :check_account_suspension
|
before_action :check_account_suspension
|
||||||
before_action :check_account_local
|
before_action :check_account_local
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::CustomEmojisController < Api::BaseController
|
class Api::V1::CustomEmojisController < EmptyController
|
||||||
respond_to :json
|
|
||||||
|
|
||||||
skip_before_action :set_cache_headers
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
render_cached_json('api:v1:custom_emojis', expires_in: 1.minute) do
|
data = ActiveModelSerializers::SerializableResource.new(CustomEmoji.local.where(disabled: false), each_serializer: REST::CustomEmojiSerializer)
|
||||||
ActiveModelSerializers::SerializableResource.new(CustomEmoji.local.where(disabled: false), each_serializer: REST::CustomEmojiSerializer)
|
render json: data.to_json, content_type: 'application/json'
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::GabTrendsController < Api::BaseController
|
class Api::V1::GabTrendsController < EmptyController
|
||||||
respond_to :json
|
|
||||||
|
|
||||||
skip_before_action :set_cache_headers
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if Rails.env != 'development'
|
if Rails.env != 'development'
|
||||||
render json: nil
|
render json: nil
|
||||||
|
@ -1,15 +1,10 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::GroupCategoriesController < Api::BaseController
|
class Api::V1::GroupCategoriesController < EmptyController
|
||||||
# respond_to :json
|
|
||||||
|
|
||||||
before_action :require_user!
|
|
||||||
skip_before_action :set_cache_headers
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
render_cached_json('api:v1:group_categories', expires_in: 1.minute) do
|
data = ActiveModelSerializers::SerializableResource.new(GroupCategories.all, each_serializer: REST::GroupCategoriesSerializer)
|
||||||
ActiveModelSerializers::SerializableResource.new(GroupCategories.all, each_serializer: REST::GroupCategoriesSerializer)
|
render json: data.to_json, content_type: 'application/json'
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::ShopController < Api::BaseController
|
class Api::V1::ShopController < EmptyController
|
||||||
before_action :require_user!
|
|
||||||
|
|
||||||
respond_to :json
|
|
||||||
|
|
||||||
skip_before_action :set_cache_headers
|
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
if Rails.env != 'development'
|
||||||
|
render json: nil
|
||||||
|
end
|
||||||
|
|
||||||
type = params[:type]
|
type = params[:type]
|
||||||
if type == 'featured_products'
|
if type == 'featured_products'
|
||||||
body = Redis.current.get("gabstore:featuredproducts")
|
body = Redis.current.get("gabstore:featuredproducts")
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class ManifestsController < ApplicationController
|
class ManifestsController < EmptyController
|
||||||
skip_before_action :store_current_location
|
|
||||||
|
|
||||||
def show
|
def show
|
||||||
render json: InstancePresenter.new, serializer: ManifestSerializer
|
render json: InstancePresenter.new, serializer: ManifestSerializer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user