This commit is contained in:
James Cole 2020-06-27 13:41:27 +02:00
parent 3e8a4d55ef
commit 7945220825
2 changed files with 3 additions and 2 deletions

View File

@ -577,7 +577,8 @@ class CurrencyController extends Controller
{
$manager = $this->getManager();
$currency = app('amount')->getDefaultCurrencyByUser(auth()->user());
$this->parameters->set('defaultCurrency', $currency);
/** @var CurrencyTransformer $transformer */
$transformer = app(CurrencyTransformer::class);
$transformer->setParameters($this->parameters);

View File

@ -55,7 +55,7 @@ class CurrencyTransformer extends AbstractTransformer
$isDefault = false;
$defaultCurrency = $this->parameters->get('defaultCurrency');
if (null !== $defaultCurrency) {
$isDefault = $defaultCurrency->id === $currency->id;
$isDefault = (int) $defaultCurrency->id === (int) $currency->id;
}
$data = [
'id' => (int)$currency->id,