mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update RelationshipTransformer
This commit is contained in:
parent
3679332114
commit
1e541e34ee
1 changed files with 6 additions and 5 deletions
|
@ -10,13 +10,14 @@ class RelationshipTransformer extends Fractal\TransformerAbstract
|
||||||
{
|
{
|
||||||
public function transform(Profile $profile)
|
public function transform(Profile $profile)
|
||||||
{
|
{
|
||||||
$user = Auth::user()->profile;
|
$auth = Auth::check();
|
||||||
|
$user = $auth ? Auth::user()->profile : false;
|
||||||
return [
|
return [
|
||||||
'id' => (string) $profile->id,
|
'id' => (string) $profile->id,
|
||||||
'following' => $user->follows($profile),
|
'following' => $auth ? $user->follows($profile) : false,
|
||||||
'followed_by' => $user->followedBy($profile),
|
'followed_by' => $auth ? $user->followedBy($profile) : false,
|
||||||
'blocking' => $user->blockedIds()->contains($profile->id),
|
'blocking' => $auth ? $user->blockedIds()->contains($profile->id) : false,
|
||||||
'muting' => $user->mutedIds()->contains($profile->id),
|
'muting' => $auth ? $user->mutedIds()->contains($profile->id) : false,
|
||||||
'muting_notifications' => null,
|
'muting_notifications' => null,
|
||||||
'requested' => null,
|
'requested' => null,
|
||||||
'domain_blocking' => null,
|
'domain_blocking' => null,
|
||||||
|
|
Loading…
Reference in a new issue