Serialize poll limits in instance serializer and initial state
This commit is contained in:
@@ -4,7 +4,7 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||
include RoutingHelper
|
||||
|
||||
attributes :uri, :title, :description, :email,
|
||||
:version, :urls, :stats, :thumbnail, :max_toot_chars,
|
||||
:version, :urls, :stats, :thumbnail, :max_toot_chars, :poll_limits,
|
||||
:languages, :registrations
|
||||
|
||||
has_one :contact_account, serializer: REST::AccountSerializer
|
||||
@@ -39,6 +39,15 @@ class REST::InstanceSerializer < ActiveModel::Serializer
|
||||
StatusLengthValidator::MAX_CHARS
|
||||
end
|
||||
|
||||
def poll_limits
|
||||
{
|
||||
max_options: PollValidator::MAX_OPTIONS,
|
||||
max_option_chars: PollValidator::MAX_OPTION_CHARS,
|
||||
min_expiration: PollValidator::MAX_EXPIRATION,
|
||||
max_expiration: PollValidator::MIN_EXPIRATION,
|
||||
}
|
||||
end
|
||||
|
||||
def stats
|
||||
{
|
||||
user_count: instance_presenter.user_count,
|
||||
|
Reference in New Issue
Block a user