Browse Source

show toot chars limit and poll limit in instance api (for mobile app)

closed-social-v3
欧醚 3 months ago
parent
commit
fa687d53a6
1 changed files with 15 additions and 1 deletions
  1. +15
    -1
      app/serializers/rest/instance_serializer.rb

+ 15
- 1
app/serializers/rest/instance_serializer.rb View File

@ -5,7 +5,8 @@ class REST::InstanceSerializer < ActiveModel::Serializer
attributes :uri, :title, :short_description, :description, :email,
:version, :urls, :stats, :thumbnail,
:languages, :registrations, :approval_required, :invites_enabled
:languages, :registrations, :approval_required, :invites_enabled,
:max_toot_chars, :poll_limits
has_one :contact_account, serializer: REST::AccountSerializer
@ -69,6 +70,19 @@ class REST::InstanceSerializer < ActiveModel::Serializer
Setting.min_invite_role == 'user'
end
def max_toot_chars
5000
end
def poll_limits
{
max_options: 10,
max_expiration: 2592000,
min_expiration: 300,
max_option_chars: 50
}
end
private
def instance_presenter

Loading…
Cancel
Save