mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 01:05:36 +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();
|
$profile = Profile::whereUsername($username)->first();
|
||||||
$status = Status::whereProfileId($profile->id)->find($postid);
|
$status = Status::whereProfileId($profile->id)->find($postid);
|
||||||
$status = new Fractal\Resource\Item($status, new StatusTransformer());
|
$item = new Fractal\Resource\Item($status, new StatusTransformer());
|
||||||
$res = [
|
$res = [
|
||||||
'status' => $this->fractal->createData($status)->toArray(),
|
'status' => $this->fractal->createData($item)->toArray(),
|
||||||
'user' => $this->getUserData()
|
'user' => $this->getUserData(),
|
||||||
|
'reactions' => [
|
||||||
|
'liked' => $status->liked(),
|
||||||
|
'shared' => $status->shared(),
|
||||||
|
'bookmarked' => $status->bookmarked(),
|
||||||
|
],
|
||||||
];
|
];
|
||||||
return response()->json($res, 200, [], JSON_PRETTY_PRINT);
|
return response()->json($res, 200, [], JSON_PRETTY_PRINT);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue