1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Add company plan to user account API response

This commit is contained in:
Hillel Coren 2016-10-21 14:29:01 +03:00
parent fc683784fc
commit 4320a72692

View File

@ -10,7 +10,7 @@ class UserAccountTransformer extends EntityTransformer
];
protected $tokenName;
public function __construct(Account $account, $serializer, $tokenName)
{
parent::__construct($account, $serializer);
@ -27,12 +27,13 @@ class UserAccountTransformer extends EntityTransformer
public function transform(User $user)
{
return [
'account_key' => $user->account->account_key,
'name' => $user->account->present()->name,
'token' => $user->account->getToken($user->id, $this->tokenName),
'account_key' => $this->account->account_key,
'name' => $this->account->present()->name,
'token' => $this->account->getToken($user->id, $this->tokenName),
'default_url' => SITE_URL,
'logo' => $user->account->logo,
'logo_url' => $user->account->getLogoURL(),
'plan' => $this->account->company->plan,
'logo' => $this->account->logo,
'logo_url' => $this->account->getLogoURL(),
];
}
}
}