Merge remote-tracking branch 'parent/main' into kb_migration

This commit is contained in:
KMY 2023-04-27 12:05:58 +09:00
commit 9264284cf4
163 changed files with 3596 additions and 1088 deletions

View file

@ -6,10 +6,15 @@ class Api::V1::Instances::DomainBlocksController < Api::BaseController
before_action :require_enabled_api!
before_action :set_domain_blocks
vary_by ''
vary_by '', if: -> { Setting.show_domain_blocks == 'all' }
def index
cache_even_if_authenticated!
if Setting.show_domain_blocks == 'all'
cache_even_if_authenticated!
else
cache_if_unauthenticated!
end
render json: @domain_blocks, each_serializer: REST::DomainBlockSerializer, with_comment: (Setting.show_domain_blocks_rationale == 'all' || (Setting.show_domain_blocks_rationale == 'users' && user_signed_in?))
end