Update AccountTransformer, tfw you confuse javascript and php operators

This commit is contained in:
Daniel Supernault 2019-09-26 21:36:49 -06:00
parent 70f4b8607a
commit e4669a8aab
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -11,7 +11,7 @@ class AccountTransformer extends Fractal\TransformerAbstract
{ {
$local = $profile->domain == null; $local = $profile->domain == null;
$is_admin = !$local ? false : $profile->user->is_admin; $is_admin = !$local ? false : $profile->user->is_admin;
$acct = $local ? $profile->username + '@' + config('pixelfed.domain.app') : substr($profile->username, 1); $acct = $local ? $profile->username . '@' . config('pixelfed.domain.app') : substr($profile->username, 1);
$username = $local ? $profile->username : explode('@', $acct)[0]; $username = $local ? $profile->username : explode('@', $acct)[0];
return [ return [
'id' => (string) $profile->id, 'id' => (string) $profile->id,