mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-09 21:50:45 +00:00
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
2 changed files with 2 additions and 2 deletions
|
@ -49,7 +49,7 @@ class CreateNote extends Fractal\TransformerAbstract
|
||||||
'to' => $status->scopeToAudience('to'),
|
'to' => $status->scopeToAudience('to'),
|
||||||
'cc' => $status->scopeToAudience('cc'),
|
'cc' => $status->scopeToAudience('cc'),
|
||||||
'sensitive' => (bool) $status->is_nsfw,
|
'sensitive' => (bool) $status->is_nsfw,
|
||||||
'attachment' => $status->media->map(function ($media) {
|
'attachment' => $status->media()->orderBy('order')->get()->map(function ($media) {
|
||||||
return [
|
return [
|
||||||
'type' => $media->activityVerb(),
|
'type' => $media->activityVerb(),
|
||||||
'mediaType' => $media->mime,
|
'mediaType' => $media->mime,
|
||||||
|
|
|
@ -42,7 +42,7 @@ class Note extends Fractal\TransformerAbstract
|
||||||
'to' => $status->scopeToAudience('to'),
|
'to' => $status->scopeToAudience('to'),
|
||||||
'cc' => $status->scopeToAudience('cc'),
|
'cc' => $status->scopeToAudience('cc'),
|
||||||
'sensitive' => (bool) $status->is_nsfw,
|
'sensitive' => (bool) $status->is_nsfw,
|
||||||
'attachment' => $status->media->map(function ($media) {
|
'attachment' => $status->media()->orderBy('order')->get()->map(function ($media) {
|
||||||
return [
|
return [
|
||||||
'type' => $media->activityVerb(),
|
'type' => $media->activityVerb(),
|
||||||
'mediaType' => $media->mime,
|
'mediaType' => $media->mime,
|
||||||
|
|
Loading…
Reference in a new issue