diff --git a/app/Api/V1/Controllers/CurrencyController.php b/app/Api/V1/Controllers/CurrencyController.php index 1e139c98d9..b6dae5fcb1 100644 --- a/app/Api/V1/Controllers/CurrencyController.php +++ b/app/Api/V1/Controllers/CurrencyController.php @@ -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); diff --git a/app/Transformers/CurrencyTransformer.php b/app/Transformers/CurrencyTransformer.php index 53cd4adfbc..33a7fa188f 100644 --- a/app/Transformers/CurrencyTransformer.php +++ b/app/Transformers/CurrencyTransformer.php @@ -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,