Update AP Note transformers to return media attachments in proper order

pull/995/head
Daniel Supernault 6 years ago
parent 332cae6392
commit 24c052aea5
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -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,

@ -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,

Loading…
Cancel
Save