mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 14:12:15 +00:00
Expand search.
This commit is contained in:
@@ -84,7 +84,10 @@ class SetCategory implements ActionInterface
|
||||
$user = User::find($journal['user_id']);
|
||||
$search = $this->action->action_value;
|
||||
|
||||
$category = $user->categories()->where('name', $search)->first();
|
||||
/** @var CategoryFactory $factory */
|
||||
$factory = app(CategoryFactory::class);
|
||||
$factory->setUser($user);
|
||||
$category = $factory->findOrCreate(null, $search);
|
||||
if (null === $category) {
|
||||
Log::debug(sprintf('RuleAction SetCategory could not set category of journal #%d to "%s" because no such category exists.', $journal['transaction_journal_id'], $search));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user