Event for clone

This commit is contained in:
James Cole
2021-02-22 18:41:03 +01:00
parent 860fc507b7
commit 6d9acd1dc2

View File

@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Transaction;
use FireflyIII\Events\StoredTransactionGroup;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
@@ -68,6 +69,9 @@ class CreateController extends Controller
$service = app(GroupCloneService::class);
$newGroup = $service->cloneGroup($group);
// event!
event(new StoredTransactionGroup($newGroup, true));
app('preferences')->mark();
$title = $newGroup->title ?? $newGroup->transactionJournals->first()->description;