mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 16:53:17 +00:00
Update PublicApiController
This commit is contained in:
parent
3e4910e3df
commit
b1e9cd0972
1 changed files with 8 additions and 3 deletions
|
@ -50,10 +50,15 @@ class PublicApiController extends Controller
|
|||
{
|
||||
$profile = Profile::whereUsername($username)->first();
|
||||
$status = Status::whereProfileId($profile->id)->find($postid);
|
||||
$status = new Fractal\Resource\Item($status, new StatusTransformer());
|
||||
$item = new Fractal\Resource\Item($status, new StatusTransformer());
|
||||
$res = [
|
||||
'status' => $this->fractal->createData($status)->toArray(),
|
||||
'user' => $this->getUserData()
|
||||
'status' => $this->fractal->createData($item)->toArray(),
|
||||
'user' => $this->getUserData(),
|
||||
'reactions' => [
|
||||
'liked' => $status->liked(),
|
||||
'shared' => $status->shared(),
|
||||
'bookmarked' => $status->bookmarked(),
|
||||
],
|
||||
];
|
||||
return response()->json($res, 200, [], JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue