Add account_id attribute to AnnualReport entity (#37182)

This commit is contained in:
Claire
2025-12-09 16:59:40 +01:00
committed by GitHub
parent 4cdcdaa7d9
commit 697569e5f9
2 changed files with 6 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ class GeneratedAnnualReport < ApplicationRecord
when 1
data['most_reblogged_accounts'].pluck('account_id') + data['commonly_interacted_with_accounts'].pluck('account_id')
when 2
[]
[account_id]
end
end

View File

@@ -3,9 +3,13 @@
class REST::AnnualReportSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :year, :data, :schema_version, :share_url
attributes :year, :data, :schema_version, :share_url, :account_id
def share_url
public_wrapstodon_url(object.account, object.year, object.share_key) if object.share_key.present?
end
def account_id
object.account_id.to_s
end
end