mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
16 lines
539 B
Ruby
16 lines
539 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Api::V1::Instances::TermsOfServiceController < Api::V1::Instances::BaseController
|
|
before_action :cache_even_if_authenticated!
|
|
|
|
def index
|
|
@terms_of_service = TermsOfService.current || raise(ActiveRecord::RecordNotFound)
|
|
render json: @terms_of_service, serializer: REST::TermsOfServiceSerializer
|
|
end
|
|
|
|
def show
|
|
@terms_of_service = TermsOfService.published.find_by!(effective_date: params[:date])
|
|
render json: @terms_of_service, serializer: REST::TermsOfServiceSerializer
|
|
end
|
|
end
|