mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-02 20:25:28 +00:00
Expand code to be able to handle updates.
This commit is contained in:
@@ -26,6 +26,7 @@ use Carbon\Carbon;
|
||||
use ExpandedForm;
|
||||
use FireflyIII\Events\StoredTransactionJournal;
|
||||
use FireflyIII\Events\UpdatedTransactionJournal;
|
||||
use FireflyIII\Factory\TransactionJournalFactory;
|
||||
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
|
||||
use FireflyIII\Http\Controllers\Controller;
|
||||
use FireflyIII\Http\Requests\JournalFormRequest;
|
||||
@@ -341,9 +342,10 @@ class SingleController extends Controller
|
||||
$data = $request->getJournalData();
|
||||
|
||||
// todo call factory instead of repository
|
||||
|
||||
|
||||
$journal = $repository->store($data);
|
||||
$factory = app(TransactionJournalFactory::class);
|
||||
$factory->setUser(auth()->user());
|
||||
$journal = $repository->store($data);
|
||||
//$journal = $repository->store($data);
|
||||
if (null === $journal->id) {
|
||||
// error!
|
||||
Log::error('Could not store transaction journal: ', $journal->getErrors()->toArray());
|
||||
|
||||
Reference in New Issue
Block a user