1
0
Fork 0

Update AP Note transformers to return media attachments in proper order

This commit is contained in:
Daniel Supernault 2019-03-08 23:49:41 -07:00
parent 332cae6392
commit 24c052aea5
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ class CreateNote extends Fractal\TransformerAbstract
'to' => $status->scopeToAudience('to'),
'cc' => $status->scopeToAudience('cc'),
'sensitive' => (bool) $status->is_nsfw,
'attachment' => $status->media->map(function ($media) {
'attachment' => $status->media()->orderBy('order')->get()->map(function ($media) {
return [
'type' => $media->activityVerb(),
'mediaType' => $media->mime,

View File

@ -42,7 +42,7 @@ class Note extends Fractal\TransformerAbstract
'to' => $status->scopeToAudience('to'),
'cc' => $status->scopeToAudience('cc'),
'sensitive' => (bool) $status->is_nsfw,
'attachment' => $status->media->map(function ($media) {
'attachment' => $status->media()->orderBy('order')->get()->map(function ($media) {
return [
'type' => $media->activityVerb(),
'mediaType' => $media->mime,