Merge pull request #995 from pixelfed/frontend-ui-refactor

Update AP Note transformers to return media attachments in proper order
This commit is contained in:
daniel 2019-03-08 23:50:28 -07:00 committed by GitHub
commit 917010e2e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,