mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Improve recurrences
This commit is contained in:
@@ -429,13 +429,19 @@ class RecurringRepository implements RecurringRepositoryInterface
|
||||
* @param array $data
|
||||
*
|
||||
* @return Recurrence
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function store(array $data): Recurrence
|
||||
{
|
||||
$factory = new RecurrenceFactory;
|
||||
/** @var RecurrenceFactory $factory */
|
||||
$factory = app(RecurrenceFactory::class);
|
||||
$factory->setUser($this->user);
|
||||
$result = $factory->create($data);
|
||||
if (null === $result) {
|
||||
throw new FireflyException($factory->getErrors()->first());
|
||||
}
|
||||
|
||||
return $factory->create($data);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -176,10 +176,9 @@ interface RecurringRepositoryInterface
|
||||
|
||||
/**
|
||||
* Store a new recurring transaction.
|
||||
*\
|
||||
*
|
||||
* @param array $data
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @return Recurrence
|
||||
*/
|
||||
public function store(array $data): Recurrence;
|
||||
|
Reference in New Issue
Block a user