Restore missing methods and fix silly bugs.

This commit is contained in:
James Cole
2023-10-24 18:32:24 +02:00
parent 64b9234207
commit 32a36bbb12
16 changed files with 397 additions and 273 deletions

View File

@@ -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;

View File

@@ -37,7 +37,6 @@ use Illuminate\Support\Collection;
*/
interface CurrencyRepositoryInterface
{
/**
* Returns the complete set of transactions but needs
* no user object.