Update AccountTransformer, I need some coffee

This commit is contained in:
Daniel Supernault 2019-09-20 23:20:22 -06:00
parent 403163f12f
commit 1ff7ba909e
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 1 additions and 1 deletions

View File

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