Fix local collection uri not being serialized in REST API responses (#38645)
This commit is contained in:
parent
3b39562954
commit
8124d44ee1
@ -13,6 +13,10 @@ class REST::CollectionSerializer < ActiveModel::Serializer
|
|||||||
object.id.to_s
|
object.id.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def uri
|
||||||
|
ActivityPub::TagManager.instance.uri_for(object)
|
||||||
|
end
|
||||||
|
|
||||||
def description
|
def description
|
||||||
return object.description if object.local?
|
return object.description if object.local?
|
||||||
return if object.description_html.nil?
|
return if object.description_html.nil?
|
||||||
|
|||||||
@ -29,6 +29,7 @@ RSpec.describe REST::CollectionSerializer do
|
|||||||
expect(subject)
|
expect(subject)
|
||||||
.to include(
|
.to include(
|
||||||
'account_id' => collection.account_id.to_s,
|
'account_id' => collection.account_id.to_s,
|
||||||
|
'uri' => include('2342'),
|
||||||
'id' => '2342',
|
'id' => '2342',
|
||||||
'name' => 'Exquisite follows',
|
'name' => 'Exquisite follows',
|
||||||
'description' => 'Always worth a follow',
|
'description' => 'Always worth a follow',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user