mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Restore missing methods and fix silly bugs.
This commit is contained in:
@@ -546,13 +546,12 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
*/
|
||||
public function store(array $data): TransactionCurrency
|
||||
{
|
||||
throw new FireflyException(sprintf('Method "%s" needs a refactor.', __METHOD__));
|
||||
/** @var TransactionCurrencyFactory $factory */
|
||||
$factory = app(TransactionCurrencyFactory::class);
|
||||
$result = $factory->create($data);
|
||||
|
||||
if (null === $result) {
|
||||
throw new FireflyException('400004: Could not store new currency.');
|
||||
if (true === $data['enabled']) {
|
||||
$this->user->currencies()->attach($result->id);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
Reference in New Issue
Block a user