mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update StatusService
This commit is contained in:
parent
1da08feed0
commit
0539018f11
1 changed files with 7 additions and 7 deletions
|
@ -30,9 +30,9 @@ class StatusService
|
||||||
if (! $status) {
|
if (! $status) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
$fractal = new Fractal\Manager();
|
$fractal = new Fractal\Manager;
|
||||||
$fractal->setSerializer(new ArraySerializer());
|
$fractal->setSerializer(new ArraySerializer);
|
||||||
$resource = new Fractal\Resource\Item($status, new StatusStatelessTransformer());
|
$resource = new Fractal\Resource\Item($status, new StatusStatelessTransformer);
|
||||||
$res = $fractal->createData($resource)->toArray();
|
$res = $fractal->createData($resource)->toArray();
|
||||||
$res['_pid'] = isset($res['account']) && isset($res['account']['id']) ? $res['account']['id'] : null;
|
$res['_pid'] = isset($res['account']) && isset($res['account']['id']) ? $res['account']['id'] : null;
|
||||||
if (isset($res['_pid'])) {
|
if (isset($res['_pid'])) {
|
||||||
|
@ -112,7 +112,7 @@ class StatusService
|
||||||
{
|
{
|
||||||
$status = self::get($id, false);
|
$status = self::get($id, false);
|
||||||
|
|
||||||
if (! $status) {
|
if (! $status || ! $pid) {
|
||||||
return [
|
return [
|
||||||
'liked' => false,
|
'liked' => false,
|
||||||
'shared' => false,
|
'shared' => false,
|
||||||
|
@ -146,9 +146,9 @@ class StatusService
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fractal = new Fractal\Manager();
|
$fractal = new Fractal\Manager;
|
||||||
$fractal->setSerializer(new ArraySerializer());
|
$fractal->setSerializer(new ArraySerializer);
|
||||||
$resource = new Fractal\Resource\Item($status, new StatusStatelessTransformer());
|
$resource = new Fractal\Resource\Item($status, new StatusStatelessTransformer);
|
||||||
|
|
||||||
return $fractal->createData($resource)->toArray();
|
return $fractal->createData($resource)->toArray();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue