Update PublicApiController

This commit is contained in:
Daniel Supernault 2020-05-23 23:04:28 -06:00
parent 4e0617ac84
commit c4ebe9dca9
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -558,6 +558,7 @@ class PublicApiController extends Controller
'likes_count',
'reblogs_count',
'scope',
'visibility',
'local',
'cw_summary',
'created_at',
@ -568,12 +569,13 @@ class PublicApiController extends Controller
->whereIn('visibility', $visibility)
->latest()
->limit($limit)
->orderByDesc('created_at')
->get();
$resource = new Fractal\Resource\Collection($timeline, new StatusTransformer());
$res = $this->fractal->createData($resource)->toArray();
return response()->json($res);
return response()->json($res, 200, [], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
}
}