Serialize poll limits in instance serializer and initial state
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
class InitialStateSerializer < ActiveModel::Serializer
|
||||
attributes :meta, :compose, :accounts,
|
||||
:media_attachments, :settings,
|
||||
:max_toot_chars
|
||||
:max_toot_chars, :poll_limits
|
||||
|
||||
has_one :push_subscription, serializer: REST::WebPushSubscriptionSerializer
|
||||
|
||||
@@ -11,6 +11,15 @@ class InitialStateSerializer < 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 meta
|
||||
store = {
|
||||
streaming_api_base_url: Rails.configuration.x.streaming_api_base_url,
|
||||
|
||||
Reference in New Issue
Block a user