Commit 0499184b authored by 2458773093's avatar 2458773093

added active promoted statuses to initial state

parent 044e9695
......@@ -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
......
# frozen_string_literal: true
class REST::PromotionSerializer < ActiveModel::Serializer
attributes :status_id, :timeline_id, :position
end
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