added active promoted statuses to initial state

This commit is contained in:
2458773093 2019-08-31 09:15:32 +03:00
parent 044e9695fe
commit 0499184b38
2 changed files with 11 additions and 1 deletions

View File

@ -2,7 +2,8 @@
class InitialStateSerializer < ActiveModel::Serializer
attributes :meta, :compose, :accounts,
:media_attachments, :settings
:media_attachments, :settings,
:promotions
has_one :push_subscription, serializer: REST::WebPushSubscriptionSerializer
@ -65,6 +66,10 @@ class InitialStateSerializer < ActiveModel::Serializer
{ accept_content_types: MediaAttachment::IMAGE_FILE_EXTENSIONS + MediaAttachment::VIDEO_FILE_EXTENSIONS + MediaAttachment::IMAGE_MIME_TYPES + MediaAttachment::VIDEO_MIME_TYPES }
end
def promotions
ActiveModelSerializers::SerializableResource.new(Promotion.active, each_serializer: REST::PromotionSerializer)
end
private
def instance_presenter

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
class REST::PromotionSerializer < ActiveModel::Serializer
attributes :status_id, :timeline_id, :position
end