mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +00:00
Add account_id attribute to AnnualReport entity (#37182)
This commit is contained in:
@@ -33,7 +33,7 @@ class GeneratedAnnualReport < ApplicationRecord
|
|||||||
when 1
|
when 1
|
||||||
data['most_reblogged_accounts'].pluck('account_id') + data['commonly_interacted_with_accounts'].pluck('account_id')
|
data['most_reblogged_accounts'].pluck('account_id') + data['commonly_interacted_with_accounts'].pluck('account_id')
|
||||||
when 2
|
when 2
|
||||||
[]
|
[account_id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,13 @@
|
|||||||
class REST::AnnualReportSerializer < ActiveModel::Serializer
|
class REST::AnnualReportSerializer < ActiveModel::Serializer
|
||||||
include RoutingHelper
|
include RoutingHelper
|
||||||
|
|
||||||
attributes :year, :data, :schema_version, :share_url
|
attributes :year, :data, :schema_version, :share_url, :account_id
|
||||||
|
|
||||||
def share_url
|
def share_url
|
||||||
public_wrapstodon_url(object.account, object.year, object.share_key) if object.share_key.present?
|
public_wrapstodon_url(object.account, object.year, object.share_key) if object.share_key.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def account_id
|
||||||
|
object.account_id.to_s
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user