added active promoted statuses to initial state
This commit is contained in:
parent
044e9695fe
commit
0499184b38
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
class InitialStateSerializer < ActiveModel::Serializer
|
class InitialStateSerializer < ActiveModel::Serializer
|
||||||
attributes :meta, :compose, :accounts,
|
attributes :meta, :compose, :accounts,
|
||||||
:media_attachments, :settings
|
:media_attachments, :settings,
|
||||||
|
:promotions
|
||||||
|
|
||||||
has_one :push_subscription, serializer: REST::WebPushSubscriptionSerializer
|
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 }
|
{ accept_content_types: MediaAttachment::IMAGE_FILE_EXTENSIONS + MediaAttachment::VIDEO_FILE_EXTENSIONS + MediaAttachment::IMAGE_MIME_TYPES + MediaAttachment::VIDEO_MIME_TYPES }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def promotions
|
||||||
|
ActiveModelSerializers::SerializableResource.new(Promotion.active, each_serializer: REST::PromotionSerializer)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def instance_presenter
|
def instance_presenter
|
||||||
|
5
app/serializers/rest/promotion_serializer.rb
Normal file
5
app/serializers/rest/promotion_serializer.rb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
class REST::PromotionSerializer < ActiveModel::Serializer
|
||||||
|
attributes :status_id, :timeline_id, :position
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user