forked from mirror/pixelfed
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:
commit
917010e2e5
|
@ -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…
Reference in New Issue