Unverified Commit d61d1646 authored by Eugen Rochko's avatar Eugen Rochko Committed by GitHub

Add `short_description` and `approval_required` to `GET /api/v1/instance` (#11146)

parent aa9b3782
......@@ -3,9 +3,9 @@
class REST::InstanceSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :uri, :title, :description, :email,
attributes :uri, :title, :short_description, :description, :email,
:version, :urls, :stats, :thumbnail,
:languages, :registrations
:languages, :registrations, :approval_required
has_one :contact_account, serializer: REST::AccountSerializer
......@@ -19,6 +19,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
Setting.site_title
end
def short_description
Setting.site_short_description
end
def description
Setting.site_description
end
......@@ -55,6 +59,10 @@ class REST::InstanceSerializer < ActiveModel::Serializer
Setting.registrations_mode != 'none' && !Rails.configuration.x.single_user_mode
end
def approval_required
Setting.registrations_mode == 'approved'
end
private
def instance_presenter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment